diff options
author | bitpshr <mail@bitpshr.net> | 2018-09-28 02:19:09 +0800 |
---|---|---|
committer | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2018-11-06 07:07:09 +0800 |
commit | c76c9ca2c86317f902f443db2c5704d4bf6311c0 (patch) | |
tree | e6b182dd8b0eb849d93143ecbd1217640aa8f490 /ui/app/components/pages/provider-approval | |
parent | 2d4ff1dd82252cbe1abe06206fb2664f96905d91 (diff) | |
download | tangerine-wallet-browser-c76c9ca2c86317f902f443db2c5704d4bf6311c0.tar.gz tangerine-wallet-browser-c76c9ca2c86317f902f443db2c5704d4bf6311c0.tar.zst tangerine-wallet-browser-c76c9ca2c86317f902f443db2c5704d4bf6311c0.zip |
EIP-1102: updated implementation
Diffstat (limited to 'ui/app/components/pages/provider-approval')
3 files changed, 48 insertions, 0 deletions
diff --git a/ui/app/components/pages/provider-approval/index.js b/ui/app/components/pages/provider-approval/index.js new file mode 100644 index 000000000..4162f3155 --- /dev/null +++ b/ui/app/components/pages/provider-approval/index.js @@ -0,0 +1 @@ +export { default } from './provider-approval.container' diff --git a/ui/app/components/pages/provider-approval/provider-approval.component.js b/ui/app/components/pages/provider-approval/provider-approval.component.js new file mode 100644 index 000000000..67e8bdd4c --- /dev/null +++ b/ui/app/components/pages/provider-approval/provider-approval.component.js @@ -0,0 +1,35 @@ +import PageContainerContent from '../../page-container' +import PropTypes from 'prop-types' +import React, { Component } from 'react' + +export default class ProviderApproval extends Component { + static propTypes = { + approveProviderRequest: PropTypes.func, + origin: PropTypes.string, + rejectProviderRequest: PropTypes.func, + }; + + static contextTypes = { + t: PropTypes.func, + }; + + render () { + const { approveProviderRequest, origin, rejectProviderRequest } = this.props + return ( + <PageContainerContent + title={this.context.t('providerAPIRequest')} + subtitle={this.context.t('reviewProviderRequest')} + contentComponent={( + <div className="provider_approval_content"> + {this.context.t('providerRequestInfo')} + <div className="provider_approval_origin">{origin}</div> + </div> + )} + submitText={this.context.t('approve')} + cancelText={this.context.t('reject')} + onSubmit={() => { approveProviderRequest(origin) }} + onCancel={() => { rejectProviderRequest(origin) }} + onClose={() => { rejectProviderRequest(origin) }} /> + ) + } +} diff --git a/ui/app/components/pages/provider-approval/provider-approval.container.js b/ui/app/components/pages/provider-approval/provider-approval.container.js new file mode 100644 index 000000000..b223244a1 --- /dev/null +++ b/ui/app/components/pages/provider-approval/provider-approval.container.js @@ -0,0 +1,12 @@ +import { connect } from 'react-redux' +import ProviderApproval from './provider-approval.component' +import { approveProviderRequest, rejectProviderRequest } from '../../../actions' + +function mapDispatchToProps (dispatch) { + return { + approveProviderRequest: origin => dispatch(approveProviderRequest(origin)), + rejectProviderRequest: origin => dispatch(rejectProviderRequest(origin)), + } +} + +export default connect(null, mapDispatchToProps)(ProviderApproval) |