1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-28 05:12:18 +01:00
metamask-extension/ui/app/components/modals/clear-approved-origins/clear-approved-origins.component.js
2018-11-05 15:07:09 -08:00

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>
)
}
}