mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-02 14:15:06 +01:00
40 lines
908 B
JavaScript
40 lines
908 B
JavaScript
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>
|
|
)
|
|
}
|
|
}
|