From 9d577ea0231802279ea0070a598f7dea9637f652 Mon Sep 17 00:00:00 2001 From: Frankie Date: Wed, 6 Jul 2016 17:04:09 -0700 Subject: Add decimal hendeling to ETH balance --- ui/app/components/eth-balance.js | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'ui/app/components/eth-balance.js') diff --git a/ui/app/components/eth-balance.js b/ui/app/components/eth-balance.js index c7240ea21..0294d0d9f 100644 --- a/ui/app/components/eth-balance.js +++ b/ui/app/components/eth-balance.js @@ -2,6 +2,7 @@ const Component = require('react').Component const h = require('react-hyperscript') const inherits = require('util').inherits const formatBalance = require('../util').formatBalance +const Tooltip = require('./tooltip') module.exports = EthBalanceComponent @@ -30,28 +31,31 @@ EthBalanceComponent.prototype.render = function () { ) } EthBalanceComponent.prototype.renderBalance = function (value) { - if (value === 'None') return value - var balance = value.split(' ')[0] - var label = value.split(' ')[1] + var balance = value.formatted.split(' ')[0] + var label = value.formatted.split(' ')[1] return ( - h('.flex-column', { - style: { - alignItems: 'flex-end', - lineHeight: '13px', - fontFamily: 'Montserrat Thin', - textRendering: 'geometricPrecision', - }, + h(Tooltip, { + title: value.balance, }, [ - h('div', balance), - h('div', { + h('.flex-column', { style: { - color: ' #AEAEAE', - fontSize: '12px', + alignItems: 'flex-end', + lineHeight: '13px', + fontFamily: 'Montserrat Light', + textRendering: 'geometricPrecision', }, - }, label), + }, [ + h('div', balance), + h('div', { + style: { + color: ' #AEAEAE', + fontSize: '12px', + }, + }, label), + ]), ]) ) } -- cgit From 53eefc1efc65c138c8692bb069ae64e5eae9942b Mon Sep 17 00:00:00 2001 From: Frankie Date: Wed, 6 Jul 2016 17:09:53 -0700 Subject: Add a postion option for tool tip --- ui/app/components/eth-balance.js | 1 + 1 file changed, 1 insertion(+) (limited to 'ui/app/components/eth-balance.js') diff --git a/ui/app/components/eth-balance.js b/ui/app/components/eth-balance.js index 0294d0d9f..510b620f3 100644 --- a/ui/app/components/eth-balance.js +++ b/ui/app/components/eth-balance.js @@ -39,6 +39,7 @@ EthBalanceComponent.prototype.renderBalance = function (value) { return ( h(Tooltip, { title: value.balance, + position: 'bottom', }, [ h('.flex-column', { style: { -- cgit