diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-10-21 13:59:53 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-10-21 13:59:53 +0800 |
commit | 9c1b2108f69334884473eb95758e2d1c02c984d6 (patch) | |
tree | 93f5255399307a28cb9380dc23c275b406403929 /ui/app/components/currency-display/currency-display.container.js | |
parent | 13820b6cc1801a420f39cdfecd7ccb5309dc597b (diff) | |
parent | b0c649a4e3c68293e08e764bbf4d53939df88e2d (diff) | |
download | tangerine-wallet-browser-9c1b2108f69334884473eb95758e2d1c02c984d6.tar.gz tangerine-wallet-browser-9c1b2108f69334884473eb95758e2d1c02c984d6.tar.zst tangerine-wallet-browser-9c1b2108f69334884473eb95758e2d1c02c984d6.zip |
fix merge conflicts
Diffstat (limited to 'ui/app/components/currency-display/currency-display.container.js')
-rw-r--r-- | ui/app/components/currency-display/currency-display.container.js | 25 |
1 files changed, 22 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 6644a1099..b387229b5 100644 --- a/ui/app/components/currency-display/currency-display.container.js +++ b/ui/app/components/currency-display/currency-display.container.js @@ -2,10 +2,26 @@ import { connect } from 'react-redux' import CurrencyDisplay from './currency-display.component' import { getValueFromWeiHex, formatCurrency } from '../../helpers/confirm-transaction/util' -const mapStateToProps = (state, ownProps) => { - const { value, numberOfDecimals = 2, currency, denomination, hideLabel } = ownProps +const mapStateToProps = state => { const { metamask: { currentCurrency, conversionRate } } = state + return { + currentCurrency, + conversionRate, + } +} + +const mergeProps = (stateProps, dispatchProps, ownProps) => { + const { currentCurrency, conversionRate, ...restStateProps } = stateProps + const { + value, + numberOfDecimals = 2, + currency, + denomination, + hideLabel, + ...restOwnProps + } = ownProps + const toCurrency = currency || currentCurrency const convertedValue = getValueFromWeiHex({ value, toCurrency, conversionRate, numberOfDecimals, toDenomination: denomination, @@ -14,8 +30,11 @@ const mapStateToProps = (state, ownProps) => { const displayValue = hideLabel ? formattedValue : `${formattedValue} ${toCurrency.toUpperCase()}` return { + ...restStateProps, + ...dispatchProps, + ...restOwnProps, displayValue, } } -export default connect(mapStateToProps)(CurrencyDisplay) +export default connect(mapStateToProps, null, mergeProps)(CurrencyDisplay) |