diff options
Diffstat (limited to 'ui/app/components/currency-display/currency-display.container.js')
-rw-r--r-- | ui/app/components/currency-display/currency-display.container.js | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/ui/app/components/currency-display/currency-display.container.js b/ui/app/components/currency-display/currency-display.container.js deleted file mode 100644 index e581f8a5e..000000000 --- a/ui/app/components/currency-display/currency-display.container.js +++ /dev/null @@ -1,51 +0,0 @@ -import { connect } from 'react-redux' -import CurrencyDisplay from './currency-display.component' -import { getValueFromWeiHex, formatCurrency } from '../../helpers/confirm-transaction/util' - -const mapStateToProps = state => { - const { metamask: { nativeCurrency, currentCurrency, conversionRate } } = state - - return { - currentCurrency, - conversionRate, - nativeCurrency, - } -} - -const mergeProps = (stateProps, dispatchProps, ownProps) => { - const { nativeCurrency, currentCurrency, conversionRate, ...restStateProps } = stateProps - const { - value, - numberOfDecimals = 2, - currency, - denomination, - hideLabel, - displayValue: propsDisplayValue, - suffix: propsSuffix, - ...restOwnProps - } = ownProps - - const toCurrency = currency || currentCurrency - - const displayValue = propsDisplayValue || formatCurrency( - getValueFromWeiHex({ - value, - fromCurrency: nativeCurrency, - toCurrency, conversionRate, - numberOfDecimals, - toDenomination: denomination, - }), - toCurrency - ) - const suffix = propsSuffix || (hideLabel ? undefined : toCurrency.toUpperCase()) - - return { - ...restStateProps, - ...dispatchProps, - ...restOwnProps, - displayValue, - suffix, - } -} - -export default connect(mapStateToProps, null, mergeProps)(CurrencyDisplay) |