aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/modals/force-injection/force-injection.component.js
blob: 1ea08b5ee113daf3f95364096e7638137e7d4a03 (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
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import Modal, { ModalContent } from '../../modal'

export default class ForceInjection extends PureComponent {
  static propTypes = {
    hideModal: PropTypes.func.isRequired,
    forceInjection: PropTypes.func.isRequired,
  }

  static contextTypes = {
    t: PropTypes.func,
  }

  handleForce = () => {
    const { forceInjection, hideModal } = this.props
    forceInjection()
    hideModal()
  }

  render () {
    const { t } = this.context

    return (
      <Modal
        onSubmit={this.handleForce}
        onCancel={() => this.props.hideModal()}
        submitText={t('ok')}
        cancelText={t('nevermind')}
        submitType="secondary"
      >
        <ModalContent
          title={t('exposeAccounts')}
          description={t('confirmExpose')}
        />
      </Modal>
    )
  }
}