diff options
author | Dan <danjm.com@gmail.com> | 2017-12-20 01:32:32 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-12-21 02:21:36 +0800 |
commit | 109e4e5d96e31b52fcfdb22620bff113107d000c (patch) | |
tree | 2717772cb69c8a6f22e96ecd307a5f822a9b7dda /ui/app | |
parent | 0feb5b210b81533fc25c4760ce33876b4c749247 (diff) | |
download | tangerine-wallet-browser-109e4e5d96e31b52fcfdb22620bff113107d000c.tar tangerine-wallet-browser-109e4e5d96e31b52fcfdb22620bff113107d000c.tar.gz tangerine-wallet-browser-109e4e5d96e31b52fcfdb22620bff113107d000c.tar.bz2 tangerine-wallet-browser-109e4e5d96e31b52fcfdb22620bff113107d000c.tar.lz tangerine-wallet-browser-109e4e5d96e31b52fcfdb22620bff113107d000c.tar.xz tangerine-wallet-browser-109e4e5d96e31b52fcfdb22620bff113107d000c.tar.zst tangerine-wallet-browser-109e4e5d96e31b52fcfdb22620bff113107d000c.zip |
Hide fiat values on account details screen when eth/token value is 0.
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/components/balance-component.js | 3 | ||||
-rw-r--r-- | ui/app/components/token-cell.js | 4 | ||||
-rw-r--r-- | ui/app/components/tx-list-item.js | 4 |
3 files changed, 8 insertions, 3 deletions
diff --git a/ui/app/components/balance-component.js b/ui/app/components/balance-component.js index d14aa675f..50007ce14 100644 --- a/ui/app/components/balance-component.js +++ b/ui/app/components/balance-component.js @@ -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: {}, diff --git a/ui/app/components/token-cell.js b/ui/app/components/token-cell.js index b40c0ec0d..677b66830 100644 --- a/ui/app/components/token-cell.js +++ b/ui/app/components/token-cell.js @@ -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 diff --git a/ui/app/components/tx-list-item.js b/ui/app/components/tx-list-item.js index 4e76147a1..8a9253d4d 100644 --- a/ui/app/components/tx-list-item.js +++ b/ui/app/components/tx-list-item.js @@ -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), ]), ]), |