diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-09-01 03:14:06 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-09-13 10:48:51 +0800 |
commit | 702b7568820d7a695f191df6bf44c76b37fdc7d8 (patch) | |
tree | ccec9173e15bd7d455ee8c0137f9c3f53af093e8 /ui/app/components/currency-display/currency-display.container.js | |
parent | e5ca2aac6f123e3e1db5e18c5854351c58af42b2 (diff) | |
download | tangerine-wallet-browser-702b7568820d7a695f191df6bf44c76b37fdc7d8.tar.gz tangerine-wallet-browser-702b7568820d7a695f191df6bf44c76b37fdc7d8.tar.zst tangerine-wallet-browser-702b7568820d7a695f191df6bf44c76b37fdc7d8.zip |
Allow denominations in CurrencyDisplay component
Diffstat (limited to 'ui/app/components/currency-display/currency-display.container.js')
-rw-r--r-- | ui/app/components/currency-display/currency-display.container.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ui/app/components/currency-display/currency-display.container.js b/ui/app/components/currency-display/currency-display.container.js index b8a738c65..6644a1099 100644 --- a/ui/app/components/currency-display/currency-display.container.js +++ b/ui/app/components/currency-display/currency-display.container.js @@ -3,13 +3,15 @@ import CurrencyDisplay from './currency-display.component' import { getValueFromWeiHex, formatCurrency } from '../../helpers/confirm-transaction/util' const mapStateToProps = (state, ownProps) => { - const { value, numberOfDecimals = 2, currency } = ownProps + const { value, numberOfDecimals = 2, currency, denomination, hideLabel } = ownProps const { metamask: { currentCurrency, conversionRate } } = state const toCurrency = currency || currentCurrency - const convertedValue = getValueFromWeiHex({ value, toCurrency, conversionRate, numberOfDecimals }) + const convertedValue = getValueFromWeiHex({ + value, toCurrency, conversionRate, numberOfDecimals, toDenomination: denomination, + }) const formattedValue = formatCurrency(convertedValue, toCurrency) - const displayValue = `${formattedValue} ${toCurrency.toUpperCase()}` + const displayValue = hideLabel ? formattedValue : `${formattedValue} ${toCurrency.toUpperCase()}` return { displayValue, |