import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Modal from '../../modal'; import { addressSummary } from '../../../../helpers/utils/util'; import Identicon from '../../../ui/identicon'; import getAccountLink from '../../../../helpers/utils/account-link'; export default class ConfirmRemoveAccount extends Component { static propTypes = { hideModal: PropTypes.func.isRequired, removeAccount: PropTypes.func.isRequired, identity: PropTypes.object.isRequired, chainId: PropTypes.string.isRequired, rpcPrefs: PropTypes.object.isRequired, }; static contextTypes = { t: PropTypes.func, }; handleRemove = () => { this.props .removeAccount(this.props.identity.address) .then(() => this.props.hideModal()); }; handleCancel = () => { this.props.hideModal(); }; renderSelectedAccount() { const { identity } = this.props; return (
Name {identity.name}
Public Address {addressSummary(identity.address, 4, 4)}
{this.context.t('etherscanView')}
); } render() { const { t } = this.context; return (
{this.renderSelectedAccount()}
{t('removeAccountDescription')} {t('learnMore')}
); } }