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

Hide fiat values on account details screen when eth/token value is 0.

This commit is contained in:
Dan 2017-12-19 14:02:32 -03:30 committed by Chi Kei Chan
parent 0feb5b210b
commit 109e4e5d96
3 changed files with 8 additions and 3 deletions

View File

@ -94,7 +94,8 @@ BalanceComponent.prototype.renderFiatValue = function (formattedBalance) {
}
BalanceComponent.prototype.renderFiatAmount = function (fiatDisplayNumber, fiatSuffix, fiatPrefix) {
if (fiatDisplayNumber === 'N/A') return null
const shouldNotRenderFiat = fiatDisplayNumber === 'N/A' || Number(fiatDisplayNumber) === 0
if (shouldNotRenderFiat) return null
return h('div.fiat-amount', {
style: {},

View File

@ -86,7 +86,9 @@ TokenCell.prototype.render = function () {
numberOfDecimals: 2,
conversionRate: currentTokenToFiatRate,
})
formattedFiat = `${currentTokenInFiat} ${currentCurrency.toUpperCase()}`
formattedFiat = currentTokenInFiat.toString() === '0'
? ''
: `${currentTokenInFiat} ${currentCurrency.toUpperCase()}`
}
const showFiat = Boolean(currentTokenInFiat) && currentCurrency.toUpperCase() !== symbol

View File

@ -170,6 +170,7 @@ TxListItem.prototype.getSendTokenTotal = async function () {
TxListItem.prototype.render = function () {
const {
transactionStatus,
transactionAmount,
onClick,
transActionId,
dateString,
@ -177,6 +178,7 @@ TxListItem.prototype.render = function () {
className,
} = this.props
const { total, fiatTotal } = this.state
const showFiatTotal = transactionAmount !== '0x0' && fiatTotal
return h(`div${className || ''}`, {
key: transActionId,
@ -238,7 +240,7 @@ TxListItem.prototype.render = function () {
}),
}, total),
fiatTotal && h('span.tx-list-fiat-value', fiatTotal),
showFiatTotal && h('span.tx-list-fiat-value', fiatTotal),
]),
]),