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

30 lines
854 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux'
2018-08-16 23:28:07 +02:00
import { compose } from 'recompose'
import ConfirmAddSuggestedToken from './confirm-add-suggested-token.component'
2018-08-16 23:28:07 +02:00
import { withRouter } from 'react-router-dom'
const extend = require('xtend')
const { addToken, removeSuggestedTokens } = require('../../../actions')
const mapStateToProps = ({ metamask }) => {
const { pendingTokens, suggestedTokens } = metamask
const params = extend(pendingTokens, suggestedTokens)
return {
pendingTokens: params,
}
}
const mapDispatchToProps = dispatch => {
return {
2018-08-23 20:54:40 +02:00
addToken: ({address, symbol, decimals, image}) => dispatch(addToken(address, symbol, decimals, image)),
removeSuggestedTokens: () => dispatch(removeSuggestedTokens()),
}
}
2018-08-16 23:28:07 +02:00
export default compose(
withRouter,
connect(mapStateToProps, mapDispatchToProps)
)(ConfirmAddSuggestedToken)