aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/identicon.js
diff options
context:
space:
mode:
authorBruno Barbieri <bruno.barbieri@consensys.net>2018-08-29 03:33:42 +0800
committerGitHub <noreply@github.com>2018-08-29 03:33:42 +0800
commit4560df6e739b97caf95ef5bc5bc93f91e8c890bb (patch)
tree76984504e65b06ae15633d721fedc7ddd5b0cca7 /ui/app/components/identicon.js
parent0259eb02140fec1db9861506a6ff7890911af652 (diff)
parente743f44150d4c09908d24945de5a281e15e8469d (diff)
downloadtangerine-wallet-browser-4560df6e739b97caf95ef5bc5bc93f91e8c890bb.tar
tangerine-wallet-browser-4560df6e739b97caf95ef5bc5bc93f91e8c890bb.tar.gz
tangerine-wallet-browser-4560df6e739b97caf95ef5bc5bc93f91e8c890bb.tar.bz2
tangerine-wallet-browser-4560df6e739b97caf95ef5bc5bc93f91e8c890bb.tar.lz
tangerine-wallet-browser-4560df6e739b97caf95ef5bc5bc93f91e8c890bb.tar.xz
tangerine-wallet-browser-4560df6e739b97caf95ef5bc5bc93f91e8c890bb.tar.zst
tangerine-wallet-browser-4560df6e739b97caf95ef5bc5bc93f91e8c890bb.zip
Merge pull request #4606 from MetaMask/WatchTokenFeature
Add metamask_watchAsset
Diffstat (limited to 'ui/app/components/identicon.js')
-rw-r--r--ui/app/components/identicon.js65
1 files changed, 35 insertions, 30 deletions
diff --git a/ui/app/components/identicon.js b/ui/app/components/identicon.js
index 80db2b8e9..076e65b81 100644
--- a/ui/app/components/identicon.js
+++ b/ui/app/components/identicon.js
@@ -26,37 +26,42 @@ function mapStateToProps (state) {
IdenticonComponent.prototype.render = function () {
var props = this.props
- const { className = '', address } = props
+ const { className = '', address, image } = props
var diameter = props.diameter || this.defaultDiameter
-
- return address
- ? (
- h('div', {
- className: `${className} identicon`,
- key: 'identicon-' + address,
- style: {
- display: 'flex',
- flexShrink: 0,
- alignItems: 'center',
- justifyContent: 'center',
- height: diameter,
- width: diameter,
- borderRadius: diameter / 2,
- overflow: 'hidden',
- },
- })
- )
- : (
- h('img', {
- className: `${className} balance-icon`,
- src: './images/eth_logo.svg',
- style: {
- height: diameter,
- width: diameter,
- borderRadius: diameter / 2,
- },
- })
- )
+ const style = {
+ height: diameter,
+ width: diameter,
+ borderRadius: diameter / 2,
+ }
+ if (image) {
+ return h('img', {
+ className: `${className} identicon`,
+ src: image,
+ style: {
+ ...style,
+ },
+ })
+ } else if (address) {
+ return h('div', {
+ className: `${className} identicon`,
+ key: 'identicon-' + address,
+ style: {
+ display: 'flex',
+ flexShrink: 0,
+ alignItems: 'center',
+ justifyContent: 'center',
+ ...style,
+ overflow: 'hidden',
+ },
+ })
+ } else {
+ return h('img.balance-icon', {
+ src: './images/eth_logo.svg',
+ style: {
+ ...style,
+ },
+ })
+ }
}
IdenticonComponent.prototype.componentDidMount = function () {