aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/account-panel.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-04-30 03:45:46 +0800
committerDan Finlay <dan@danfinlay.com>2016-04-30 03:45:46 +0800
commit9360e33510594878a141fdb2bc652df7e1643c93 (patch)
tree2108aa592a6347febe9969d47df882cd8a49ce69 /ui/app/components/account-panel.js
parent9b524b4f28bebbdf8351763b61e897f33021e25b (diff)
downloadtangerine-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/components/account-panel.js')
-rw-r--r--ui/app/components/account-panel.js12
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),
]),