diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-05-07 05:49:38 +0800 |
---|---|---|
committer | kumavis <kumavis@users.noreply.github.com> | 2016-05-07 05:49:38 +0800 |
commit | 601d870592b5d79b4a109a2dd825cb7966457dd7 (patch) | |
tree | 1a4f8aeb96d4b8456d35cf3dbb8ee14357944edf /ui/app/components/panel.js | |
parent | edf4e2bc5b5964446104b8ab4a7d6eae2d0ed0cd (diff) | |
parent | c30a67b2deb06c5d47990ccac74d9d55384bfe2e (diff) | |
download | tangerine-wallet-browser-601d870592b5d79b4a109a2dd825cb7966457dd7.tar tangerine-wallet-browser-601d870592b5d79b4a109a2dd825cb7966457dd7.tar.gz tangerine-wallet-browser-601d870592b5d79b4a109a2dd825cb7966457dd7.tar.bz2 tangerine-wallet-browser-601d870592b5d79b4a109a2dd825cb7966457dd7.tar.lz tangerine-wallet-browser-601d870592b5d79b4a109a2dd825cb7966457dd7.tar.xz tangerine-wallet-browser-601d870592b5d79b4a109a2dd825cb7966457dd7.tar.zst tangerine-wallet-browser-601d870592b5d79b4a109a2dd825cb7966457dd7.zip |
Merge pull request #180 from MetaMask/PrettierTransactionList
Prettier transaction list
Diffstat (limited to 'ui/app/components/panel.js')
-rw-r--r-- | ui/app/components/panel.js | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/ui/app/components/panel.js b/ui/app/components/panel.js new file mode 100644 index 000000000..25e6b7f0f --- /dev/null +++ b/ui/app/components/panel.js @@ -0,0 +1,63 @@ +const inherits = require('util').inherits +const ethUtil = require('ethereumjs-util') +const Component = require('react').Component +const h = require('react-hyperscript') +const Identicon = require('identicon.js') + +module.exports = Panel + + +inherits(Panel, Component) +function Panel() { + Component.call(this) +} + +Panel.prototype.render = function() { + var state = this.props + + var identity = state.identity || {} + var account = state.account || {} + var isFauceting = state.isFauceting + + var identicon = new Identicon(state.identiconKey, 46).toString() + var identiconSrc = `data:image/png;base64,${identicon}` + + return ( + h('.identity-panel.flex-row.flex-space-between', { + style: { + flex: '1 0 auto', + }, + onClick: state.onClick, + }, [ + + // account identicon + h('.identicon-wrapper.flex-column.select-none', [ + h('img.identicon', { + src: identiconSrc, + style: { + border: 'none', + borderRadius: '20px', + } + }), + h('span.font-small', state.identiconLabel), + ]), + + // account address, balance + h('.identity-data.flex-column.flex-justify-center.flex-grow.select-none', [ + + state.attributes.map((attr) => { + return h('.flex-row.flex-space-between', { + key: '' + Math.round(Math.random() * 1000000), + }, [ + h('label.font-small', attr.key), + h('span.font-small', attr.value), + ]) + }), + ]), + + // outlet for inserting additional stuff + state.children, + ]) + ) +} + |