diff options
fix conflicts
Diffstat (limited to 'ui/app/components/modals/reject-transactions/reject-transactions.component.js')
-rw-r--r-- | ui/app/components/modals/reject-transactions/reject-transactions.component.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/ui/app/components/modals/reject-transactions/reject-transactions.component.js b/ui/app/components/modals/reject-transactions/reject-transactions.component.js new file mode 100644 index 000000000..60b259bdc --- /dev/null +++ b/ui/app/components/modals/reject-transactions/reject-transactions.component.js @@ -0,0 +1,45 @@ +import PropTypes from 'prop-types' +import React, { PureComponent } from 'react' +import Modal from '../../modal' + +export default class RejectTransactionsModal extends PureComponent { + static contextTypes = { + t: PropTypes.func.isRequired, + } + + static propTypes = { + onSubmit: PropTypes.func.isRequired, + hideModal: PropTypes.func.isRequired, + unapprovedTxCount: PropTypes.number.isRequired, + } + + onSubmit = async () => { + const { onSubmit, hideModal } = this.props + + await onSubmit() + hideModal() + } + + render () { + const { t } = this.context + const { hideModal, unapprovedTxCount } = this.props + + return ( + <Modal + headerText={t('rejectTxsN', [unapprovedTxCount])} + onClose={hideModal} + onSubmit={this.onSubmit} + onCancel={hideModal} + submitText={t('rejectAll')} + cancelText={t('cancel')} + submitType="secondary" + > + <div> + <div className="reject-transactions__description"> + { t('rejectTxsDescription', [unapprovedTxCount]) } + </div> + </div> + </Modal> + ) + } +} |