1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-27 21:00:13 +01:00
metamask-extension/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js

28 lines
848 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux'
2020-02-24 23:58:26 +01:00
import { compose } from 'redux'
import ConfirmAddSuggestedToken from './confirm-add-suggested-token.component'
2018-08-16 23:28:07 +02:00
import { withRouter } from 'react-router-dom'
import { addToken, removeSuggestedTokens } from '../../store/actions'
const mapStateToProps = ({ metamask }) => {
const { pendingTokens, suggestedTokens, tokens } = metamask
2020-01-13 17:29:21 +01:00
const params = { ...pendingTokens, ...suggestedTokens }
return {
pendingTokens: params,
tokens,
}
}
2020-02-15 21:34:12 +01:00
const mapDispatchToProps = (dispatch) => {
return {
2019-12-03 21:50:55 +01:00
addToken: ({ address, symbol, decimals, image }) => dispatch(addToken(address, symbol, Number(decimals), image)),
removeSuggestedTokens: () => dispatch(removeSuggestedTokens()),
}
}
2018-08-16 23:28:07 +02:00
export default compose(
withRouter,
connect(mapStateToProps, mapDispatchToProps)
)(ConfirmAddSuggestedToken)