mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-24 19:10:22 +01:00
39 lines
884 B
JavaScript
39 lines
884 B
JavaScript
import React, { PureComponent } from 'react'
|
|
import PropTypes from 'prop-types'
|
|
import Modal, { ModalContent } from '../../modal'
|
|
|
|
export default class ConfirmResetAccount extends PureComponent {
|
|
static propTypes = {
|
|
hideModal: PropTypes.func.isRequired,
|
|
resetAccount: PropTypes.func.isRequired,
|
|
}
|
|
|
|
static contextTypes = {
|
|
t: PropTypes.func,
|
|
}
|
|
|
|
handleReset = () => {
|
|
this.props.resetAccount()
|
|
.then(() => this.props.hideModal())
|
|
}
|
|
|
|
render () {
|
|
const { t } = this.context
|
|
|
|
return (
|
|
<Modal
|
|
onSubmit={this.handleReset}
|
|
onCancel={() => this.props.hideModal()}
|
|
submitText={t('reset')}
|
|
cancelText={t('nevermind')}
|
|
submitType="secondary"
|
|
>
|
|
<ModalContent
|
|
title={`${t('resetAccount')}?`}
|
|
description={t('resetAccountDescription')}
|
|
/>
|
|
</Modal>
|
|
)
|
|
}
|
|
}
|