aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/eth-balance.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-07-08 03:27:18 +0800
committerDan Finlay <dan@danfinlay.com>2016-07-08 03:27:18 +0800
commit97b60caac0dfabaa3652fde75cfafa9551bf47ce (patch)
tree206c0cf891f08c3200a0010b5eda36b18f000c02 /ui/app/components/eth-balance.js
parent1e92e7e9d42b503302c4633be4512c0f566a4f9a (diff)
downloadtangerine-wallet-browser-97b60caac0dfabaa3652fde75cfafa9551bf47ce.tar
tangerine-wallet-browser-97b60caac0dfabaa3652fde75cfafa9551bf47ce.tar.gz
tangerine-wallet-browser-97b60caac0dfabaa3652fde75cfafa9551bf47ce.tar.bz2
tangerine-wallet-browser-97b60caac0dfabaa3652fde75cfafa9551bf47ce.tar.lz
tangerine-wallet-browser-97b60caac0dfabaa3652fde75cfafa9551bf47ce.tar.xz
tangerine-wallet-browser-97b60caac0dfabaa3652fde75cfafa9551bf47ce.tar.zst
tangerine-wallet-browser-97b60caac0dfabaa3652fde75cfafa9551bf47ce.zip
Add configurable params to eth-balance
Diffstat (limited to 'ui/app/components/eth-balance.js')
-rw-r--r--ui/app/components/eth-balance.js27
1 files changed, 17 insertions, 10 deletions
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),
])