import React, { Component } from 'react' import PropTypes from 'prop-types' import Button from '../../button' import { addressSummary } from '../../../util' import Identicon from '../../identicon' import genAccountLink from '../../../../lib/account-link' class ConfirmRemoveAccount extends Component { static propTypes = { hideModal: PropTypes.func.isRequired, removeAccount: PropTypes.func.isRequired, identity: PropTypes.object.isRequired, network: PropTypes.string.isRequired, } static contextTypes = { t: PropTypes.func, } handleRemove () { this.props.removeAccount(this.props.identity.address) .then(() => this.props.hideModal()) } renderSelectedAccount () { const { identity } = this.props return (
Name {identity.name}
Public Address { addressSummary(identity.address, 4, 4) }
) } render () { const { t } = this.context return (
{ `${t('removeAccount')}` }?
{ this.renderSelectedAccount() }
{ t('removeAccountDescription') } { t('learnMore') }
) } } export default ConfirmRemoveAccount