2018-05-20 08:04:19 +02:00
|
|
|
import { connect } from 'react-redux'
|
|
|
|
import ConfirmAddToken from './confirm-add-token.component'
|
|
|
|
|
2018-06-19 00:33:50 +02:00
|
|
|
const extend = require('xtend')
|
|
|
|
|
2018-08-04 01:24:12 +02:00
|
|
|
const { addTokens, clearPendingTokens, removeSuggestedTokens } = require('../../../actions')
|
2018-05-20 08:04:19 +02:00
|
|
|
|
|
|
|
const mapStateToProps = ({ metamask }) => {
|
2018-06-19 00:33:50 +02:00
|
|
|
const { pendingTokens, suggestedTokens } = metamask
|
|
|
|
const params = extend(pendingTokens, suggestedTokens)
|
|
|
|
|
2018-05-20 08:04:19 +02:00
|
|
|
return {
|
2018-06-19 00:33:50 +02:00
|
|
|
pendingTokens: params,
|
2018-05-20 08:04:19 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const mapDispatchToProps = dispatch => {
|
|
|
|
return {
|
|
|
|
addTokens: tokens => dispatch(addTokens(tokens)),
|
|
|
|
clearPendingTokens: () => dispatch(clearPendingTokens()),
|
2018-08-04 01:24:12 +02:00
|
|
|
removeSuggestedTokens: () => dispatch(removeSuggestedTokens()),
|
2018-05-20 08:04:19 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(ConfirmAddToken)
|