1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-02 14:15:06 +01:00
metamask-extension/ui/app/components/modals/clear-approved-origins/clear-approved-origins.component.js

40 lines
908 B
JavaScript
Raw Normal View History

2018-09-27 20:19:09 +02:00
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>
)
}
}