aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/modals/confirm-reset-account/confirm-reset-account.component.js
blob: 14a4da62a0b1b71d119544317065337b3b550a64 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import Button from '../../button'

class ConfirmResetAccount extends Component {
  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 (
      <div className="modal-container">
        <div className="modal-container__content">
          <div className="modal-container__title">
            { `${t('resetAccount')}?` }
          </div>
          <div className="modal-container__description">
            { t('resetAccountDescription') }
          </div>
        </div>
        <div className="modal-container__footer">
          <Button
            type="default"
            className="modal-container__footer-button"
            onClick={() => this.props.hideModal()}
          >
            { t('nevermind') }
          </Button>
          <Button
            type="secondary"
            className="modal-container__footer-button"
            onClick={() => this.handleReset()}
          >
            { t('reset') }
          </Button>
        </div>
      </div>
    )
  }
}

export default ConfirmResetAccount