mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-24 11:01:41 +01:00
db776b5a02
* Update privacy notice * Respond to 1102 messages using tab ID
52 lines
1.4 KiB
JavaScript
52 lines
1.4 KiB
JavaScript
import PropTypes from 'prop-types'
|
|
import React, {PureComponent} from 'react'
|
|
import { ProviderPageContainerContent, ProviderPageContainerHeader } from './'
|
|
import { PageContainerFooter } from '../page-container'
|
|
|
|
export default class ProviderPageContainer extends PureComponent {
|
|
static propTypes = {
|
|
approveProviderRequest: PropTypes.func.isRequired,
|
|
origin: PropTypes.string.isRequired,
|
|
rejectProviderRequest: PropTypes.func.isRequired,
|
|
siteImage: PropTypes.string,
|
|
siteTitle: PropTypes.string.isRequired,
|
|
tabID: PropTypes.string.isRequired,
|
|
};
|
|
|
|
static contextTypes = {
|
|
t: PropTypes.func,
|
|
};
|
|
|
|
onCancel = () => {
|
|
const { tabID, rejectProviderRequest } = this.props
|
|
rejectProviderRequest(tabID)
|
|
}
|
|
|
|
onSubmit = () => {
|
|
const { approveProviderRequest, tabID } = this.props
|
|
approveProviderRequest(tabID)
|
|
}
|
|
|
|
render () {
|
|
const {origin, siteImage, siteTitle} = this.props
|
|
|
|
return (
|
|
<div className="page-container provider-approval-container">
|
|
<ProviderPageContainerHeader />
|
|
<ProviderPageContainerContent
|
|
origin={origin}
|
|
siteImage={siteImage}
|
|
siteTitle={siteTitle}
|
|
/>
|
|
<PageContainerFooter
|
|
onCancel={() => this.onCancel()}
|
|
cancelText={this.context.t('cancel')}
|
|
onSubmit={() => this.onSubmit()}
|
|
submitText={this.context.t('connect')}
|
|
submitButtonType="confirm"
|
|
/>
|
|
</div>
|
|
)
|
|
}
|
|
}
|