diff options
author | Frankie <frankie.pangilinan@consensys.net> | 2016-09-09 03:56:48 +0800 |
---|---|---|
committer | Frankie <frankie.pangilinan@consensys.net> | 2016-09-09 03:56:48 +0800 |
commit | 69580480bc7f73c367a741b3ca69d0ccaffd6b33 (patch) | |
tree | 5b1b8e799e26a464c53b85f8937ee3da0843ac2b /ui/app/components/eth-balance.js | |
parent | 6f86c5f8ee6779eddfde1fbc32e356bbc80708f3 (diff) | |
parent | 80847739b2d79cc440aec512c84af2769bb06805 (diff) | |
download | tangerine-wallet-browser-69580480bc7f73c367a741b3ca69d0ccaffd6b33.tar tangerine-wallet-browser-69580480bc7f73c367a741b3ca69d0ccaffd6b33.tar.gz tangerine-wallet-browser-69580480bc7f73c367a741b3ca69d0ccaffd6b33.tar.bz2 tangerine-wallet-browser-69580480bc7f73c367a741b3ca69d0ccaffd6b33.tar.lz tangerine-wallet-browser-69580480bc7f73c367a741b3ca69d0ccaffd6b33.tar.xz tangerine-wallet-browser-69580480bc7f73c367a741b3ca69d0ccaffd6b33.tar.zst tangerine-wallet-browser-69580480bc7f73c367a741b3ca69d0ccaffd6b33.zip |
Merge branch 'master' into i#589pendingTxsIssue
Diffstat (limited to 'ui/app/components/eth-balance.js')
-rw-r--r-- | ui/app/components/eth-balance.js | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/ui/app/components/eth-balance.js b/ui/app/components/eth-balance.js index 498873faa..46127bed5 100644 --- a/ui/app/components/eth-balance.js +++ b/ui/app/components/eth-balance.js @@ -4,6 +4,7 @@ const inherits = require('util').inherits const formatBalance = require('../util').formatBalance const generateBalanceObject = require('../util').generateBalanceObject const Tooltip = require('./tooltip.js') +const FiatValue = require('./fiat-value.js') module.exports = EthBalanceComponent @@ -13,11 +14,11 @@ function EthBalanceComponent () { } EthBalanceComponent.prototype.render = function () { - var state = this.props - var style = state.style + var props = this.props + var style = props.style var needsParse = this.props.needsParse !== undefined ? this.props.needsParse : true - const value = formatBalance(state.value, 6, needsParse) - var width = state.width + const value = formatBalance(props.value, 6, needsParse) + var width = props.width return ( @@ -35,15 +36,16 @@ EthBalanceComponent.prototype.render = function () { ) } EthBalanceComponent.prototype.renderBalance = function (value) { - var state = this.props + var props = this.props if (value === 'None') return value - var balanceObj = generateBalanceObject(value, state.shorten ? 1 : 3) + var balanceObj = generateBalanceObject(value, props.shorten ? 1 : 3) var balance var splitBalance = value.split(' ') var ethNumber = splitBalance[0] var ethSuffix = splitBalance[1] + const showFiat = 'showFiat' in props ? props.showFiat : true - if (state.shorten) { + if (props.shorten) { balance = balanceObj.shortBalance } else { balance = balanceObj.balance @@ -55,8 +57,8 @@ EthBalanceComponent.prototype.renderBalance = function (value) { h(Tooltip, { position: 'bottom', title: `${ethNumber} ${ethSuffix}`, - }, [ - h('.flex-column', { + }, h('div.flex-column', [ + h('.flex-row', { style: { alignItems: 'flex-end', lineHeight: '13px', @@ -74,9 +76,12 @@ EthBalanceComponent.prototype.renderBalance = function (value) { style: { color: ' #AEAEAE', fontSize: '12px', + marginLeft: '5px', }, }, label), ]), - ]) + + showFiat ? h(FiatValue, { value: props.value }) : null, + ])) ) } |