diff options
author | Chi Kei Chan <chikeichan@gmail.com> | 2017-09-07 14:03:23 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-09-07 14:03:23 +0800 |
commit | 14b2f3e391752cca02c05ae0137e490bfdcdd7a7 (patch) | |
tree | d23f6397e4b21bcb3f3c009d722fa666fab79b10 /ui/app/components/balance-component.js | |
parent | f1fb9e10a06d1811d97f61b6369684979b7ecf70 (diff) | |
download | tangerine-wallet-browser-14b2f3e391752cca02c05ae0137e490bfdcdd7a7.tar tangerine-wallet-browser-14b2f3e391752cca02c05ae0137e490bfdcdd7a7.tar.gz tangerine-wallet-browser-14b2f3e391752cca02c05ae0137e490bfdcdd7a7.tar.bz2 tangerine-wallet-browser-14b2f3e391752cca02c05ae0137e490bfdcdd7a7.tar.lz tangerine-wallet-browser-14b2f3e391752cca02c05ae0137e490bfdcdd7a7.tar.xz tangerine-wallet-browser-14b2f3e391752cca02c05ae0137e490bfdcdd7a7.tar.zst tangerine-wallet-browser-14b2f3e391752cca02c05ae0137e490bfdcdd7a7.zip |
Show token balance and identicon
Diffstat (limited to 'ui/app/components/balance-component.js')
-rw-r--r-- | ui/app/components/balance-component.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/ui/app/components/balance-component.js b/ui/app/components/balance-component.js index 6b997944f..6d73d5b4a 100644 --- a/ui/app/components/balance-component.js +++ b/ui/app/components/balance-component.js @@ -3,6 +3,7 @@ const connect = require('react-redux').connect const h = require('react-hyperscript') const inherits = require('util').inherits const TokenBalance = require('./token-balance') +const Identicon = require('./identicon') const { formatBalance, generateBalanceObject } = require('../util') @@ -10,11 +11,13 @@ module.exports = connect(mapStateToProps)(BalanceComponent) function mapStateToProps (state) { const accounts = state.metamask.accounts + const network = state.metamask.network const selectedAddress = state.metamask.selectedAddress || Object.keys(accounts)[0] const account = accounts[selectedAddress] return { account, + network, conversionRate: state.metamask.conversionRate, currentCurrency: state.metamask.currentCurrency, } @@ -27,15 +30,19 @@ function BalanceComponent () { BalanceComponent.prototype.render = function () { const props = this.props - // const { balanceValue } = props - const { token } = props + const { token, network } = props return h('div.balance-container', {}, [ // TODO: balance icon needs to be passed in - h('img.balance-icon', { - src: '../images/eth_logo.svg', - style: {}, + // h('img.balance-icon', { + // src: '../images/eth_logo.svg', + // style: {}, + // }), + h(Identicon, { + diameter: 45, + address: token && token.address, + network, }), token ? this.renderTokenBalance() : this.renderBalance(), |