mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-02 14:15:06 +01:00
798930afba
* Add Swap feature to CurrencyInput * Fix linter error * Fix and Add unit tests
28 lines
693 B
JavaScript
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)
|