import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { connect } from 'react-redux'; import * as actions from '../../../../store/actions'; import Identicon from '../../../ui/identicon'; import Button from '../../../ui/button'; import { DEFAULT_ROUTE } from '../../../../helpers/constants/routes'; function mapStateToProps(state) { return { token: state.appState.modal.modalState.props.token, history: state.appState.modal.modalState.props.history, }; } function mapDispatchToProps(dispatch) { return { hideModal: () => dispatch(actions.hideModal()), hideToken: (address) => { dispatch( actions.ignoreTokens({ tokensToIgnore: address, }), ).then(() => { dispatch(actions.hideModal()); }); }, }; } class HideTokenConfirmationModal extends Component { static contextTypes = { t: PropTypes.func, }; static propTypes = { hideToken: PropTypes.func.isRequired, hideModal: PropTypes.func.isRequired, token: PropTypes.shape({ symbol: PropTypes.string, address: PropTypes.string, image: PropTypes.string, }), history: PropTypes.object, }; state = {}; render() { const { token, hideToken, hideModal, history } = this.props; const { symbol, address, image } = token; return (