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.
40 lines
908 B
40 lines
908 B
6 years ago
|
import React, { PureComponent } from 'react'
|
||
|
import PropTypes from 'prop-types'
|
||
|
import Modal, { ModalContent } from '../../modal'
|
||
|
|
||
|
export default class ClearApprovedOrigins extends PureComponent {
|
||
|
static propTypes = {
|
||
|
hideModal: PropTypes.func.isRequired,
|
||
|
clearApprovedOrigins: PropTypes.func.isRequired,
|
||
|
}
|
||
|
|
||
|
static contextTypes = {
|
||
|
t: PropTypes.func,
|
||
|
}
|
||
|
|
||
|
handleClear = () => {
|
||
|
const { clearApprovedOrigins, hideModal } = this.props
|
||
|
clearApprovedOrigins()
|
||
|
hideModal()
|
||
|
}
|
||
|
|
||
|
render () {
|
||
|
const { t } = this.context
|
||
|
|
||
|
return (
|
||
|
<Modal
|
||
|
onSubmit={this.handleClear}
|
||
|
onCancel={() => this.props.hideModal()}
|
||
|
submitText={t('ok')}
|
||
|
cancelText={t('nevermind')}
|
||
|
submitType="secondary"
|
||
|
>
|
||
|
<ModalContent
|
||
|
title={t('clearApprovalData')}
|
||
|
description={t('confirmClear')}
|
||
|
/>
|
||
|
</Modal>
|
||
|
)
|
||
|
}
|
||
|
}
|