diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-08-06 03:18:44 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-08-06 03:18:44 +0800 |
commit | 260de6532c50dceebee93acab70a3319afdb16fb (patch) | |
tree | e57a4015675d2f0e4a8a72809b40e4572400fff8 /ui | |
parent | be76b05726a5431249ed651ff1282cc584b0724b (diff) | |
download | tangerine-wallet-browser-260de6532c50dceebee93acab70a3319afdb16fb.tar tangerine-wallet-browser-260de6532c50dceebee93acab70a3319afdb16fb.tar.gz tangerine-wallet-browser-260de6532c50dceebee93acab70a3319afdb16fb.tar.bz2 tangerine-wallet-browser-260de6532c50dceebee93acab70a3319afdb16fb.tar.lz tangerine-wallet-browser-260de6532c50dceebee93acab70a3319afdb16fb.tar.xz tangerine-wallet-browser-260de6532c50dceebee93acab70a3319afdb16fb.tar.zst tangerine-wallet-browser-260de6532c50dceebee93acab70a3319afdb16fb.zip |
Get fiat numbers rendering on tooltip. Need to find way to create line breaks.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/account-detail.js | 2 | ||||
-rw-r--r-- | ui/app/components/eth-balance.js | 23 |
2 files changed, 22 insertions, 3 deletions
diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index b1b0495eb..3cc1fb8ba 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -20,6 +20,7 @@ module.exports = connect(mapStateToProps)(AccountDetailScreen) function mapStateToProps (state) { return { + metamask: state.metamask, identities: state.metamask.identities, accounts: state.metamask.accounts, address: state.metamask.selectedAccount, @@ -250,4 +251,3 @@ AccountDetailScreen.prototype.transactionList = function () { AccountDetailScreen.prototype.requestAccountExport = function () { this.props.dispatch(actions.requestExportAccount()) } - diff --git a/ui/app/components/eth-balance.js b/ui/app/components/eth-balance.js index 612ef7779..4ecb436ee 100644 --- a/ui/app/components/eth-balance.js +++ b/ui/app/components/eth-balance.js @@ -1,10 +1,22 @@ const Component = require('react').Component const h = require('react-hyperscript') const inherits = require('util').inherits +const connect = require('react-redux').connect const formatBalance = require('../util').formatBalance const generateBalanceObject = require('../util').generateBalanceObject const Tooltip = require('./tooltip.js') -module.exports = EthBalanceComponent + + +function mapStateToProps (state) { + return { + conversionRate: state.metamask.conversionRate, + conversionDate: state.metamask.conversionDate, + currentFiat: state.metamask.currentFiat, + } +} + +module.exports = connect(mapStateToProps)(EthBalanceComponent) + inherits(EthBalanceComponent, Component) function EthBalanceComponent () { @@ -37,6 +49,11 @@ EthBalanceComponent.prototype.renderBalance = function (value, state) { if (value === 'None') return value var balanceObj = generateBalanceObject(value, state.shorten ? 1 : 3) var balance + var splitBalance = value.split(' ') + var ethNumber = splitBalance[0] + var ethSuffix = splitBalance[1] + var fiatNumber = Number(splitBalance[0]) * state.conversionRate + var fiatSuffix = state.currentFiat if (state.shorten) { balance = balanceObj.shortBalance @@ -49,7 +66,9 @@ EthBalanceComponent.prototype.renderBalance = function (value, state) { return ( h(Tooltip, { position: 'bottom', - title: value.split(' ')[0], + multiline: true, + title: `${ethNumber} ${ethSuffix} + ${fiatNumber} ${fiatSuffix}`, }, [ h('.flex-column', { style: { |