import React, { Component } from 'react' import PropTypes from 'prop-types' import Modal from '../../modal' import { addressSummary } from '../../../util' import Identicon from '../../identicon' import genAccountLink from '../../../../lib/account-link' export default 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()) } handleCancel = () => { 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 (
{ this.renderSelectedAccount() }
{ t('removeAccountDescription') } { t('learnMore') }
) } }