1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-02 14:15:06 +01:00
metamask-extension/ui/app/components/currency-input/currency-input.container.js
Chi Kei Chan 798930afba Add Swap feature to CurrencyInput (#6091)
* Add Swap feature to CurrencyInput

* Fix linter error

* Fix and Add unit tests
2019-02-06 11:44:17 -03:30

28 lines
693 B
JavaScript

import { connect } from 'react-redux'
import CurrencyInput from './currency-input.component'
import { ETH } from '../../constants/common'
const mapStateToProps = state => {
const { metamask: { nativeCurrency, currentCurrency, conversionRate } } = state
return {
nativeCurrency,
currentCurrency,
conversionRate,
}
}
const mergeProps = (stateProps, dispatchProps, ownProps) => {
const { nativeCurrency, currentCurrency } = stateProps
return {
...stateProps,
...dispatchProps,
...ownProps,
nativeSuffix: nativeCurrency || ETH,
fiatSuffix: currentCurrency.toUpperCase(),
}
}
export default connect(mapStateToProps, null, mergeProps)(CurrencyInput)