|
|
|
@ -37,7 +37,17 @@ EthBalanceComponent.prototype.render = function () { |
|
|
|
|
} |
|
|
|
|
EthBalanceComponent.prototype.renderBalance = function (value) { |
|
|
|
|
var props = this.props |
|
|
|
|
const { conversionRate, shorten, incoming, currentCurrency } = props |
|
|
|
|
const { |
|
|
|
|
conversionRate, |
|
|
|
|
shorten, |
|
|
|
|
incoming, |
|
|
|
|
currentCurrency, |
|
|
|
|
hideTooltip, |
|
|
|
|
styleOveride, |
|
|
|
|
} = props |
|
|
|
|
|
|
|
|
|
const { fontSize, color, fontFamily, lineHeight } = styleOveride |
|
|
|
|
|
|
|
|
|
if (value === 'None') return value |
|
|
|
|
if (value === '...') return value |
|
|
|
|
var balanceObj = generateBalanceObject(value, shorten ? 1 : 3) |
|
|
|
@ -54,17 +64,20 @@ EthBalanceComponent.prototype.renderBalance = function (value) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var label = balanceObj.label |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
h(Tooltip, { |
|
|
|
|
const tooltipProps = hideTooltip ? {} : { |
|
|
|
|
position: 'bottom', |
|
|
|
|
title: `${ethNumber} ${ethSuffix}`, |
|
|
|
|
}, h('div.flex-column', [ |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
h(hideTooltip ? 'div' : Tooltip, |
|
|
|
|
tooltipProps, |
|
|
|
|
h('div.flex-column', [ |
|
|
|
|
h('.flex-row', { |
|
|
|
|
style: { |
|
|
|
|
alignItems: 'flex-end', |
|
|
|
|
lineHeight: '13px', |
|
|
|
|
fontFamily: 'Montserrat Light', |
|
|
|
|
lineHeight: lineHeight || '13px', |
|
|
|
|
fontFamily: fontFamily || 'Montserrat Light', |
|
|
|
|
textRendering: 'geometricPrecision', |
|
|
|
|
}, |
|
|
|
|
}, [ |
|
|
|
@ -72,12 +85,14 @@ EthBalanceComponent.prototype.renderBalance = function (value) { |
|
|
|
|
style: { |
|
|
|
|
width: '100%', |
|
|
|
|
textAlign: 'right', |
|
|
|
|
fontSize: fontSize || 'inherit', |
|
|
|
|
color: color || 'inherit', |
|
|
|
|
}, |
|
|
|
|
}, incoming ? `+${balance}` : balance), |
|
|
|
|
h('div', { |
|
|
|
|
style: { |
|
|
|
|
color: ' #AEAEAE', |
|
|
|
|
fontSize: '12px', |
|
|
|
|
color: color || '#AEAEAE', |
|
|
|
|
fontSize: fontSize || '12px', |
|
|
|
|
marginLeft: '5px', |
|
|
|
|
}, |
|
|
|
|
}, label), |
|
|
|
|