aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2016-08-06 03:18:44 +0800
committerKevin Serrano <kevgagser@gmail.com>2016-08-06 03:18:44 +0800
commit260de6532c50dceebee93acab70a3319afdb16fb (patch)
treee57a4015675d2f0e4a8a72809b40e4572400fff8 /ui/app/components
parentbe76b05726a5431249ed651ff1282cc584b0724b (diff)
downloadtangerine-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/app/components')
-rw-r--r--ui/app/components/eth-balance.js23
1 files changed, 21 insertions, 2 deletions
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: {