diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-08-24 07:44:38 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-08-24 07:45:28 +0800 |
commit | 342522c6cf23670f931e69ba822eedfd2d6ee252 (patch) | |
tree | 7aac360f85308b3022d6f673a5c572385854e690 /ui/app/components/currency-display | |
parent | 2d76ee754b1dd2473d744ce2dba2a3501c9a149c (diff) | |
download | tangerine-wallet-browser-342522c6cf23670f931e69ba822eedfd2d6ee252.tar tangerine-wallet-browser-342522c6cf23670f931e69ba822eedfd2d6ee252.tar.gz tangerine-wallet-browser-342522c6cf23670f931e69ba822eedfd2d6ee252.tar.bz2 tangerine-wallet-browser-342522c6cf23670f931e69ba822eedfd2d6ee252.tar.lz tangerine-wallet-browser-342522c6cf23670f931e69ba822eedfd2d6ee252.tar.xz tangerine-wallet-browser-342522c6cf23670f931e69ba822eedfd2d6ee252.tar.zst tangerine-wallet-browser-342522c6cf23670f931e69ba822eedfd2d6ee252.zip |
Fix naming, add eth.getCode check for actions, fix translations for statuses
Diffstat (limited to 'ui/app/components/currency-display')
-rw-r--r-- | ui/app/components/currency-display/currency-display.component.js | 2 | ||||
-rw-r--r-- | ui/app/components/currency-display/currency-display.container.js | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/ui/app/components/currency-display/currency-display.component.js b/ui/app/components/currency-display/currency-display.component.js index f1bb933d7..389791b42 100644 --- a/ui/app/components/currency-display/currency-display.component.js +++ b/ui/app/components/currency-display/currency-display.component.js @@ -1,11 +1,13 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' +import { ETH } from '../../constants/common' export default class CurrencyDisplay extends PureComponent { static propTypes = { className: PropTypes.string, displayValue: PropTypes.string, prefix: PropTypes.string, + currency: PropTypes.oneOf([ETH]), } render () { diff --git a/ui/app/components/currency-display/currency-display.container.js b/ui/app/components/currency-display/currency-display.container.js index b36bba52a..b8a738c65 100644 --- a/ui/app/components/currency-display/currency-display.container.js +++ b/ui/app/components/currency-display/currency-display.container.js @@ -1,13 +1,12 @@ import { connect } from 'react-redux' import CurrencyDisplay from './currency-display.component' import { getValueFromWeiHex, formatCurrency } from '../../helpers/confirm-transaction/util' -import { ETH } from '../../constants/common' const mapStateToProps = (state, ownProps) => { const { value, numberOfDecimals = 2, currency } = ownProps const { metamask: { currentCurrency, conversionRate } } = state - const toCurrency = currency === ETH ? ETH : currentCurrency + const toCurrency = currency || currentCurrency const convertedValue = getValueFromWeiHex({ value, toCurrency, conversionRate, numberOfDecimals }) const formattedValue = formatCurrency(convertedValue, toCurrency) const displayValue = `${formattedValue} ${toCurrency.toUpperCase()}` |