aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEsteban MIno <efmino@uc.cl>2018-08-16 23:04:43 +0800
committerEsteban MIno <efmino@uc.cl>2018-08-16 23:04:43 +0800
commita36ea0e2328e6ffedd5b526470dc1133c4f2f556 (patch)
treef9ce81f5cf4c5893f43e99850f725a1fdf2435de
parent5289a36664f180fae1dc6da07ccc80d307f7408c (diff)
downloadtangerine-wallet-browser-a36ea0e2328e6ffedd5b526470dc1133c4f2f556.tar.gz
tangerine-wallet-browser-a36ea0e2328e6ffedd5b526470dc1133c4f2f556.tar.zst
tangerine-wallet-browser-a36ea0e2328e6ffedd5b526470dc1133c4f2f556.zip
show watch asset image from hide token modal
-rw-r--r--app/scripts/controllers/preferences.js2
-rw-r--r--ui/app/components/identicon.js21
-rw-r--r--ui/app/components/modals/hide-token-confirmation-modal.js5
3 files changed, 15 insertions, 13 deletions
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js
index 9f5826dd9..59c24f987 100644
--- a/app/scripts/controllers/preferences.js
+++ b/app/scripts/controllers/preferences.js
@@ -15,7 +15,7 @@ class PreferencesController {
* @property {string} store.currentAccountTab Indicates the selected tab in the ui
* @property {array} store.tokens The tokens the user wants display in their token lists
* @property {object} store.accountTokens The tokens stored per account and then per network type
- * @property {object} store.objects Contains assets objects related to
+ * @property {object} store.objects Contains assets objects related to assets added
* @property {boolean} store.useBlockie The users preference for blockie identicons within the UI
* @property {object} store.featureFlags A key-boolean map, where keys refer to features and booleans to whether the
* user wishes to see that feature
diff --git a/ui/app/components/identicon.js b/ui/app/components/identicon.js
index eadd6d5a2..6b632352f 100644
--- a/ui/app/components/identicon.js
+++ b/ui/app/components/identicon.js
@@ -28,14 +28,17 @@ IdenticonComponent.prototype.render = function () {
var props = this.props
const { className = '', address, imageUrl } = props
var diameter = props.diameter || this.defaultDiameter
- // for tokens added with `watchToken` we need to render the given image
+ const style = {
+ height: diameter,
+ width: diameter,
+ borderRadius: diameter / 2,
+ }
if (imageUrl) {
- return h('img.balance-icon', {
+ return h('img', {
+ className: `${className} identicon`,
src: imageUrl,
style: {
- height: diameter,
- width: diameter,
- borderRadius: diameter / 2,
+ ...style,
},
})
} else if (address) {
@@ -47,9 +50,7 @@ IdenticonComponent.prototype.render = function () {
flexShrink: 0,
alignItems: 'center',
justifyContent: 'center',
- height: diameter,
- width: diameter,
- borderRadius: diameter / 2,
+ ...style,
overflow: 'hidden',
},
})
@@ -57,9 +58,7 @@ IdenticonComponent.prototype.render = function () {
return h('img.balance-icon', {
src: './images/eth_logo.svg',
style: {
- height: diameter,
- width: diameter,
- borderRadius: diameter / 2,
+ ...style,
},
})
}
diff --git a/ui/app/components/modals/hide-token-confirmation-modal.js b/ui/app/components/modals/hide-token-confirmation-modal.js
index 1518fa9a0..b5f396e6f 100644
--- a/ui/app/components/modals/hide-token-confirmation-modal.js
+++ b/ui/app/components/modals/hide-token-confirmation-modal.js
@@ -10,6 +10,7 @@ function mapStateToProps (state) {
return {
network: state.metamask.network,
token: state.appState.modal.modalState.props.token,
+ tokenImagesHashes: state.metamask.objects,
}
}
@@ -40,8 +41,9 @@ module.exports = connect(mapStateToProps, mapDispatchToProps)(HideTokenConfirmat
HideTokenConfirmationModal.prototype.render = function () {
- const { token, network, hideToken, hideModal } = this.props
+ const { token, network, hideToken, hideModal, tokenImagesHashes } = this.props
const { symbol, address } = token
+ const imageUrl = tokenImagesHashes[address]
return h('div.hide-token-confirmation', {}, [
h('div.hide-token-confirmation__container', {
@@ -55,6 +57,7 @@ HideTokenConfirmationModal.prototype.render = function () {
diameter: 45,
address,
network,
+ imageUrl,
}),
h('div.hide-token-confirmation__symbol', {}, symbol),