mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-03 22:54:29 +01:00
28 lines
721 B
JavaScript
28 lines
721 B
JavaScript
|
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)
|