diff options
Diffstat (limited to 'ui/app/components/modals/force-injection')
3 files changed, 56 insertions, 0 deletions
diff --git a/ui/app/components/modals/force-injection/force-injection.component.js b/ui/app/components/modals/force-injection/force-injection.component.js new file mode 100644 index 000000000..1ea08b5ee --- /dev/null +++ b/ui/app/components/modals/force-injection/force-injection.component.js @@ -0,0 +1,39 @@ +import React, { PureComponent } from 'react' +import PropTypes from 'prop-types' +import Modal, { ModalContent } from '../../modal' + +export default class ForceInjection extends PureComponent { + static propTypes = { + hideModal: PropTypes.func.isRequired, + forceInjection: PropTypes.func.isRequired, + } + + static contextTypes = { + t: PropTypes.func, + } + + handleForce = () => { + const { forceInjection, hideModal } = this.props + forceInjection() + hideModal() + } + + render () { + const { t } = this.context + + return ( + <Modal + onSubmit={this.handleForce} + onCancel={() => this.props.hideModal()} + submitText={t('ok')} + cancelText={t('nevermind')} + submitType="secondary" + > + <ModalContent + title={t('exposeAccounts')} + description={t('confirmExpose')} + /> + </Modal> + ) + } +} diff --git a/ui/app/components/modals/force-injection/force-injection.container.js b/ui/app/components/modals/force-injection/force-injection.container.js new file mode 100644 index 000000000..fa0a325c3 --- /dev/null +++ b/ui/app/components/modals/force-injection/force-injection.container.js @@ -0,0 +1,16 @@ +import { connect } from 'react-redux' +import { compose } from 'recompose' +import withModalProps from '../../../higher-order-components/with-modal-props' +import ForceInjectionComponent from './force-injection.component' +import { forceInjection } from '../../../actions' + +const mapDispatchToProps = dispatch => { + return { + forceInjection: () => dispatch(forceInjection()), + } +} + +export default compose( + withModalProps, + connect(null, mapDispatchToProps) +)(ForceInjectionComponent) diff --git a/ui/app/components/modals/force-injection/index.js b/ui/app/components/modals/force-injection/index.js new file mode 100644 index 000000000..4ea4dc695 --- /dev/null +++ b/ui/app/components/modals/force-injection/index.js @@ -0,0 +1 @@ +export { default } from './force-injection.container' |