From 97b60caac0dfabaa3652fde75cfafa9551bf47ce Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 7 Jul 2016 12:27:18 -0700 Subject: Add configurable params to eth-balance --- ui/app/components/eth-balance.js | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'ui') diff --git a/ui/app/components/eth-balance.js b/ui/app/components/eth-balance.js index 113e698ad..d50ac771d 100644 --- a/ui/app/components/eth-balance.js +++ b/ui/app/components/eth-balance.js @@ -11,10 +11,10 @@ function EthBalanceComponent () { } EthBalanceComponent.prototype.render = function () { - var state = this.props - var style = state.style + var props = this.props + var style = props.style - const value = formatBalance(state.value) + const value = formatBalance(props.value) return ( @@ -31,26 +31,33 @@ EthBalanceComponent.prototype.render = function () { ) } EthBalanceComponent.prototype.renderBalance = function (value) { + const props = this.props if (value === 'None') return value var balance = value.split(' ')[0] var label = value.split(' ')[1] + var tagName = props.inline ? 'span' : 'div' + var topTag = props.inline ? 'div' : '.flex-column' return ( - h('.flex-column', { + h(topTag, { style: { alignItems: 'flex-end', - lineHeight: '13px', - fontFamily: 'Montserrat Thin', + lineHeight: props.fontSize || '13px', + fontFamily: 'Montserrat Regular', textRendering: 'geometricPrecision', }, }, [ - h('div', balance), - h('div', { + h(tagName, { style: { - color: ' #AEAEAE', - fontSize: '12px', + fontSize: props.fontSize || '12px', + } + }, balance + ' '), + h(tagName, { + style: { + color: props.labelColor || '#AEAEAE', + fontSize: props.fontSize || '12px', }, }, label), ]) -- cgit v1.2.3