Add configurable params to eth-balance

feature/default_network_editable
Dan Finlay 9 years ago
parent 1e92e7e9d4
commit 97b60caac0
  1. 27
      ui/app/components/eth-balance.js

@ -11,10 +11,10 @@ function EthBalanceComponent () {
} }
EthBalanceComponent.prototype.render = function () { EthBalanceComponent.prototype.render = function () {
var state = this.props var props = this.props
var style = state.style var style = props.style
const value = formatBalance(state.value) const value = formatBalance(props.value)
return ( return (
@ -31,26 +31,33 @@ EthBalanceComponent.prototype.render = function () {
) )
} }
EthBalanceComponent.prototype.renderBalance = function (value) { EthBalanceComponent.prototype.renderBalance = function (value) {
const props = this.props
if (value === 'None') return value if (value === 'None') return value
var balance = value.split(' ')[0] var balance = value.split(' ')[0]
var label = value.split(' ')[1] var label = value.split(' ')[1]
var tagName = props.inline ? 'span' : 'div'
var topTag = props.inline ? 'div' : '.flex-column'
return ( return (
h('.flex-column', { h(topTag, {
style: { style: {
alignItems: 'flex-end', alignItems: 'flex-end',
lineHeight: '13px', lineHeight: props.fontSize || '13px',
fontFamily: 'Montserrat Thin', fontFamily: 'Montserrat Regular',
textRendering: 'geometricPrecision', textRendering: 'geometricPrecision',
}, },
}, [ }, [
h('div', balance), h(tagName, {
h('div', {
style: { style: {
color: ' #AEAEAE', fontSize: props.fontSize || '12px',
fontSize: '12px', }
}, balance + ' '),
h(tagName, {
style: {
color: props.labelColor || '#AEAEAE',
fontSize: props.fontSize || '12px',
}, },
}, label), }, label),
]) ])

Loading…
Cancel
Save