1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-04 23:14:56 +01:00
metamask-extension/ui/components/app/modals/confirm-reset-account/confirm-reset-account.component.js

38 lines
882 B
JavaScript
Raw Normal View History

import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import Modal, { ModalContent } from '../../modal';
2018-05-31 01:17:40 +02:00
export default class ConfirmResetAccount extends PureComponent {
2018-05-31 01:17:40 +02:00
static propTypes = {
hideModal: PropTypes.func.isRequired,
resetAccount: PropTypes.func.isRequired,
};
2018-05-31 01:17:40 +02:00
static contextTypes = {
t: PropTypes.func,
};
2018-05-31 01:17:40 +02:00
handleReset = () => {
this.props.resetAccount().then(() => this.props.hideModal());
};
2018-05-31 01:17:40 +02:00
2020-11-03 00:41:28 +01:00
render() {
const { t } = this.context;
2018-05-31 01:17:40 +02:00
return (
<Modal
onSubmit={this.handleReset}
onCancel={() => this.props.hideModal()}
submitText={t('reset')}
cancelText={t('nevermind')}
submitType="danger"
>
<ModalContent
title={`${t('resetAccount')}?`}
description={t('resetAccountDescription')}
/>
</Modal>
);
2018-05-31 01:17:40 +02:00
}
}