1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Got basic fiat display modularized

This commit is contained in:
Dan Finlay 2016-09-06 17:08:56 -07:00
parent 90638f95c0
commit c46de79c10
3 changed files with 26 additions and 22 deletions

View File

@ -57,30 +57,32 @@ EthBalanceComponent.prototype.renderBalance = function (value) {
h(Tooltip, { h(Tooltip, {
position: 'bottom', position: 'bottom',
title: `${ethNumber} ${ethSuffix}`, title: `${ethNumber} ${ethSuffix}`,
}, [ }, h('div.flex-column', [
h('.flex-column', { h('.flex-row', {
style: {
alignItems: 'flex-end',
lineHeight: '13px',
fontFamily: 'Montserrat Light',
textRendering: 'geometricPrecision',
},
}, [
h('div', {
style: { style: {
width: '100%', alignItems: 'flex-end',
textAlign: 'right', lineHeight: '13px',
fontFamily: 'Montserrat Light',
textRendering: 'geometricPrecision',
}, },
}, this.props.incoming ? `+${balance}` : balance), }, [
h('div', { h('div', {
style: { style: {
color: ' #AEAEAE', width: '100%',
fontSize: '12px', textAlign: 'right',
}, },
}, label), }, this.props.incoming ? `+${balance}` : balance),
]), h('div', {
style: {
color: ' #AEAEAE',
fontSize: '12px',
marginLeft: '5px',
},
}, label),
]),
showFiat ? h(FiatValue, { value: props.value }) : null, showFiat ? h(FiatValue, { value: props.value }) : null,
]) ])
)
) )
} }

View File

@ -32,6 +32,7 @@ FiatValue.prototype.render = function () {
fiatDisplayNumber = fiatTooltipNumber.toFixed(2) fiatDisplayNumber = fiatTooltipNumber.toFixed(2)
} else { } else {
fiatDisplayNumber = 'N/A' fiatDisplayNumber = 'N/A'
fiatTooltipNumber = 'Unknown'
} }
var fiatSuffix = props.currentFiat var fiatSuffix = props.currentFiat

View File

@ -11,6 +11,7 @@ function Tooltip () {
} }
Tooltip.prototype.render = function () { Tooltip.prototype.render = function () {
const props = this.props const props = this.props
const { position, title, children } = props const { position, title, children } = props