diff options
add support for images base64 and urls on new ui
Diffstat (limited to 'ui/app/components/pages')
2 files changed, 10 insertions, 7 deletions
diff --git a/ui/app/components/pages/confirm-add-suggested-token/confirm-add-suggested-token.component.js b/ui/app/components/pages/confirm-add-suggested-token/confirm-add-suggested-token.component.js index 2220ae685..5de0859cd 100644 --- a/ui/app/components/pages/confirm-add-suggested-token/confirm-add-suggested-token.component.js +++ b/ui/app/components/pages/confirm-add-suggested-token/confirm-add-suggested-token.component.js @@ -13,7 +13,7 @@ export default class ConfirmAddSuggestedToken extends Component { static propTypes = { history: PropTypes.object, clearPendingTokens: PropTypes.func, - addTokens: PropTypes.func, + addToken: PropTypes.func, pendingTokens: PropTypes.object, removeSuggestedTokens: PropTypes.func, } @@ -33,7 +33,9 @@ export default class ConfirmAddSuggestedToken extends Component { } render () { - const { addTokens, clearPendingTokens, pendingTokens, removeSuggestedTokens } = this.props + const { addToken, clearPendingTokens, pendingTokens, removeSuggestedTokens } = this.props + const pendingTokenKey = Object.keys(pendingTokens)[0] + const pendingToken = pendingTokens[pendingTokenKey] return ( <div className="page-container"> @@ -59,7 +61,7 @@ export default class ConfirmAddSuggestedToken extends Component { { Object.entries(pendingTokens) .map(([ address, token ]) => { - const { name, symbol } = token + const { name, symbol, imageUrl } = token return ( <div @@ -71,6 +73,7 @@ export default class ConfirmAddSuggestedToken extends Component { className="confirm-add-token__token-icon" diameter={48} address={address} + imageUrl={imageUrl} /> <div className="confirm-add-token__name"> { this.getTokenName(name, symbol) } @@ -102,14 +105,14 @@ export default class ConfirmAddSuggestedToken extends Component { large className="page-container__footer-button" onClick={() => { - addTokens(pendingTokens) + addToken(pendingToken) .then(() => { clearPendingTokens() removeSuggestedTokens() }) }} > - { this.context.t('addTokens') } + { this.context.t('addToken') } </Button> </div> </div> diff --git a/ui/app/components/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js b/ui/app/components/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js index 938c363b4..fba33222e 100644 --- a/ui/app/components/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js +++ b/ui/app/components/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js @@ -3,7 +3,7 @@ import ConfirmAddSuggestedToken from './confirm-add-suggested-token.component' const extend = require('xtend') -const { addTokens, clearPendingTokens, removeSuggestedTokens } = require('../../../actions') +const { addToken, clearPendingTokens, removeSuggestedTokens } = require('../../../actions') const mapStateToProps = ({ metamask }) => { const { pendingTokens, suggestedTokens } = metamask @@ -16,7 +16,7 @@ const mapStateToProps = ({ metamask }) => { const mapDispatchToProps = dispatch => { return { - addTokens: tokens => dispatch(addTokens(tokens)), + addToken: ({address, symbol, decimals, imageUrl}) => dispatch(addToken(address, symbol, decimals, imageUrl)), clearPendingTokens: () => dispatch(clearPendingTokens()), removeSuggestedTokens: () => dispatch(removeSuggestedTokens()), } |