aboutsummaryrefslogblamecommitdiffstats
path: root/ui/app/components/pages/confirm-add-token/confirm-add-token.container.js
blob: 500b406bb2d6b3df4781084772f8086a26867e08 (plain) (tree)
1
2
3
4
5
6
7
8


                                                           

                               
                                                                     

                                           


                                                       
          
                          










                                                                            
import { connect } from 'react-redux'
import ConfirmAddToken from './confirm-add-token.component'

const extend = require('xtend')

const { addTokens, clearPendingTokens } = require('../../../actions')

const mapStateToProps = ({ metamask }) => {
  const { pendingTokens, suggestedTokens } = metamask
  const params = extend(pendingTokens, suggestedTokens)

  return {
    pendingTokens: params,
  }
}

const mapDispatchToProps = dispatch => {
  return {
    addTokens: tokens => dispatch(addTokens(tokens)),
    clearPendingTokens: () => dispatch(clearPendingTokens()),
  }
}

export default connect(mapStateToProps, mapDispatchToProps)(ConfirmAddToken)