diff options
author | Frankie <frankie.pangilinan@consensys.net> | 2016-06-09 05:12:25 +0800 |
---|---|---|
committer | Frankie <frankie.pangilinan@consensys.net> | 2016-06-09 05:12:25 +0800 |
commit | 03e9ff6e42fe230a1f7a0e6185eca57248c7a2ed (patch) | |
tree | e47867a4f8a8ad4d6ed3ae200cc08c7f0dc1f88c /ui/app/components/identicon.js | |
parent | e9407777cc6f44a87a4c34e07562f278d66a48c4 (diff) | |
parent | 1836b83a530a001b83bffebbcf3483220fa02a21 (diff) | |
download | tangerine-wallet-browser-03e9ff6e42fe230a1f7a0e6185eca57248c7a2ed.tar tangerine-wallet-browser-03e9ff6e42fe230a1f7a0e6185eca57248c7a2ed.tar.gz tangerine-wallet-browser-03e9ff6e42fe230a1f7a0e6185eca57248c7a2ed.tar.bz2 tangerine-wallet-browser-03e9ff6e42fe230a1f7a0e6185eca57248c7a2ed.tar.lz tangerine-wallet-browser-03e9ff6e42fe230a1f7a0e6185eca57248c7a2ed.tar.xz tangerine-wallet-browser-03e9ff6e42fe230a1f7a0e6185eca57248c7a2ed.tar.zst tangerine-wallet-browser-03e9ff6e42fe230a1f7a0e6185eca57248c7a2ed.zip |
Mend CHANGE.log
Diffstat (limited to 'ui/app/components/identicon.js')
-rw-r--r-- | ui/app/components/identicon.js | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/ui/app/components/identicon.js b/ui/app/components/identicon.js index ef625cc62..fd61b3125 100644 --- a/ui/app/components/identicon.js +++ b/ui/app/components/identicon.js @@ -1,8 +1,10 @@ const Component = require('react').Component const h = require('react-hyperscript') const inherits = require('util').inherits -const jazzicon = require('jazzicon') const findDOMNode = require('react-dom').findDOMNode +const jazzicon = require('jazzicon') +const iconFactoryGen = require('../../lib/icon-factory') +const iconFactory = iconFactoryGen(jazzicon) module.exports = IdenticonComponent @@ -35,21 +37,14 @@ IdenticonComponent.prototype.componentDidMount = function(){ var address = state.address if (!address) return - var numericRepresentation = jsNumberForAddress(address) var container = findDOMNode(this) - // jazzicon with hack to fix inline svg error + var diameter = state.diameter || this.defaultDiameter - var identicon = jazzicon(diameter, numericRepresentation) - var identiconSrc = identicon.innerHTML - var dataUri = 'data:image/svg+xml;charset=utf-8,'+encodeURIComponent(identiconSrc) + var dataUri = iconFactory.iconForAddress(address, diameter) + var img = document.createElement('img') img.src = dataUri container.appendChild(img) } -function jsNumberForAddress(address) { - var addr = address.slice(2, 10) - var seed = parseInt(addr, 16) - return seed -} |