1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-24 02:58:09 +01:00
metamask-extension/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.container.js
2020-02-24 19:28:26 -03:30

28 lines
848 B
JavaScript

import { connect } from 'react-redux'
import { compose } from 'redux'
import ConfirmAddSuggestedToken from './confirm-add-suggested-token.component'
import { withRouter } from 'react-router-dom'
import { addToken, removeSuggestedTokens } from '../../store/actions'
const mapStateToProps = ({ metamask }) => {
const { pendingTokens, suggestedTokens, tokens } = metamask
const params = { ...pendingTokens, ...suggestedTokens }
return {
pendingTokens: params,
tokens,
}
}
const mapDispatchToProps = (dispatch) => {
return {
addToken: ({ address, symbol, decimals, image }) => dispatch(addToken(address, symbol, Number(decimals), image)),
removeSuggestedTokens: () => dispatch(removeSuggestedTokens()),
}
}
export default compose(
withRouter,
connect(mapStateToProps, mapDispatchToProps)
)(ConfirmAddSuggestedToken)