You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
882 B
37 lines
882 B
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="danger"
|
|
>
|
|
<ModalContent
|
|
title={`${t('resetAccount')}?`}
|
|
description={t('resetAccountDescription')}
|
|
/>
|
|
</Modal>
|
|
);
|
|
}
|
|
}
|
|
|