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.
38 lines
882 B
38 lines
882 B
4 years ago
|
import React, { PureComponent } from 'react';
|
||
|
import PropTypes from 'prop-types';
|
||
|
import Modal, { ModalContent } from '../../modal';
|
||
7 years ago
|
|
||
6 years ago
|
export default class ConfirmResetAccount extends PureComponent {
|
||
7 years ago
|
static propTypes = {
|
||
|
hideModal: PropTypes.func.isRequired,
|
||
|
resetAccount: PropTypes.func.isRequired,
|
||
4 years ago
|
};
|
||
7 years ago
|
|
||
|
static contextTypes = {
|
||
|
t: PropTypes.func,
|
||
4 years ago
|
};
|
||
7 years ago
|
|
||
6 years ago
|
handleReset = () => {
|
||
4 years ago
|
this.props.resetAccount().then(() => this.props.hideModal());
|
||
|
};
|
||
7 years ago
|
|
||
4 years ago
|
render() {
|
||
4 years ago
|
const { t } = this.context;
|
||
7 years ago
|
|
||
|
return (
|
||
6 years ago
|
<Modal
|
||
|
onSubmit={this.handleReset}
|
||
|
onCancel={() => this.props.hideModal()}
|
||
|
submitText={t('reset')}
|
||
|
cancelText={t('nevermind')}
|
||
5 years ago
|
submitType="danger"
|
||
6 years ago
|
>
|
||
|
<ModalContent
|
||
|
title={`${t('resetAccount')}?`}
|
||
|
description={t('resetAccountDescription')}
|
||
|
/>
|
||
|
</Modal>
|
||
4 years ago
|
);
|
||
7 years ago
|
}
|
||
|
}
|