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