aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/currency-display
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/currency-display')
-rw-r--r--ui/app/components/currency-display/currency-display.component.js2
-rw-r--r--ui/app/components/currency-display/currency-display.container.js3
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()}`