2021-02-04 19:15:23 +01:00
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import Modal, { ModalContent } from '../../modal';
|
2018-05-31 01:17:40 +02:00
|
|
|
|
2018-09-17 19:34:29 +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,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-05-31 01:17:40 +02:00
|
|
|
|
|
|
|
static contextTypes = {
|
|
|
|
t: PropTypes.func,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-05-31 01:17:40 +02:00
|
|
|
|
2018-09-17 19:34:29 +02:00
|
|
|
handleReset = () => {
|
2021-02-04 19:15:23 +01:00
|
|
|
this.props.resetAccount().then(() => this.props.hideModal());
|
|
|
|
};
|
2018-05-31 01:17:40 +02:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
render() {
|
2021-02-04 19:15:23 +01:00
|
|
|
const { t } = this.context;
|
2018-05-31 01:17:40 +02:00
|
|
|
|
|
|
|
return (
|
2018-09-17 19:34:29 +02:00
|
|
|
<Modal
|
|
|
|
onSubmit={this.handleReset}
|
|
|
|
onCancel={() => this.props.hideModal()}
|
|
|
|
submitText={t('reset')}
|
|
|
|
cancelText={t('nevermind')}
|
2019-12-12 21:33:05 +01:00
|
|
|
submitType="danger"
|
2018-09-17 19:34:29 +02:00
|
|
|
>
|
|
|
|
<ModalContent
|
|
|
|
title={`${t('resetAccount')}?`}
|
|
|
|
description={t('resetAccountDescription')}
|
|
|
|
/>
|
|
|
|
</Modal>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2018-05-31 01:17:40 +02:00
|
|
|
}
|
|
|
|
}
|