You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
721 B
27 lines
721 B
import { connect } from 'react-redux'
|
|
import TokenInput from './token-input.component'
|
|
import { getSelectedToken, getSelectedTokenExchangeRate } from '../../selectors'
|
|
|
|
const mapStateToProps = state => {
|
|
const { metamask: { currentCurrency } } = state
|
|
|
|
return {
|
|
currentCurrency,
|
|
selectedToken: getSelectedToken(state),
|
|
selectedTokenExchangeRate: getSelectedTokenExchangeRate(state),
|
|
}
|
|
}
|
|
|
|
const mergeProps = (stateProps, dispatchProps, ownProps) => {
|
|
const { selectedToken } = stateProps
|
|
const suffix = selectedToken && selectedToken.symbol
|
|
|
|
return {
|
|
...stateProps,
|
|
...dispatchProps,
|
|
...ownProps,
|
|
suffix,
|
|
}
|
|
}
|
|
|
|
export default connect(mapStateToProps, null, mergeProps)(TokenInput)
|
|
|