diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-04-30 03:45:46 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-04-30 03:45:46 +0800 |
commit | 9360e33510594878a141fdb2bc652df7e1643c93 (patch) | |
tree | 2108aa592a6347febe9969d47df882cd8a49ce69 /ui/app | |
parent | 9b524b4f28bebbdf8351763b61e897f33021e25b (diff) | |
download | tangerine-wallet-browser-9360e33510594878a141fdb2bc652df7e1643c93.tar tangerine-wallet-browser-9360e33510594878a141fdb2bc652df7e1643c93.tar.gz tangerine-wallet-browser-9360e33510594878a141fdb2bc652df7e1643c93.tar.bz2 tangerine-wallet-browser-9360e33510594878a141fdb2bc652df7e1643c93.tar.lz tangerine-wallet-browser-9360e33510594878a141fdb2bc652df7e1643c93.tar.xz tangerine-wallet-browser-9360e33510594878a141fdb2bc652df7e1643c93.tar.zst tangerine-wallet-browser-9360e33510594878a141fdb2bc652df7e1643c93.zip |
Convert icons to identicons
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/components/account-panel.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ui/app/components/account-panel.js b/ui/app/components/account-panel.js index 9fda2ebfc..25b5e5d24 100644 --- a/ui/app/components/account-panel.js +++ b/ui/app/components/account-panel.js @@ -4,6 +4,7 @@ const Component = require('react').Component const h = require('react-hyperscript') const addressSummary = require('../util').addressSummary const formatBalance = require('../util').formatBalance +const Identicon = require('identicon.js') module.exports = AccountPanel @@ -19,6 +20,9 @@ AccountPanel.prototype.render = function() { var account = state.account || {} var isFauceting = state.isFauceting + var identicon = new Identicon(identity.address, 46).toString() + var identiconSrc = `data:image/png;base64,${identicon}` + return ( h('.identity-panel.flex-row.flex-space-between'+(state.isSelected?'.selected':''), { @@ -30,8 +34,12 @@ AccountPanel.prototype.render = function() { // account identicon h('.identicon-wrapper.flex-column.select-none', [ - h('.identicon', { - style: { backgroundImage: 'url("https://ipfs.io/ipfs/'+identity.img+'")' } + h('img.identicon', { + src: identiconSrc, + style: { + border: 'none', + borderRadius: '20px', + } }), h('span.font-small', identity.name), ]), |