blob: a5d40730879a7330790a99e91ed9fe8ab5b97a04 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
import { connect } from 'react-redux'
import CurrencyInput from './currency-input.component'
import { DEX } from '../../constants/common'
const mapStateToProps = state => {
const { dekusan: { nativeCurrency, currentCurrency, conversionRate } } = state
return {
nativeCurrency,
currentCurrency,
conversionRate,
}
}
const mergeProps = (stateProps, dispatchProps, ownProps) => {
const { currentCurrency } = stateProps
const { useFiat } = ownProps
const suffix = useFiat ? currentCurrency.toUpperCase() : DEX
return {
...stateProps,
...dispatchProps,
...ownProps,
suffix,
}
}
export default connect(mapStateToProps, null, mergeProps)(CurrencyInput)
|