aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/modals/reject-transactions/reject-transactions.component.js
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-09-24 13:07:19 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-10-02 00:14:54 +0800
commit2e35c05f148a823d04b5a0009afd45b3fcd1d3fa (patch)
tree503dedcb95b80db7ef435c7ca1f68a65f1126933 /ui/app/components/modals/reject-transactions/reject-transactions.component.js
parent7610248f8c09f9fb86da700ae2818e9b4bd07832 (diff)
downloadtangerine-wallet-browser-2e35c05f148a823d04b5a0009afd45b3fcd1d3fa.tar.gz
tangerine-wallet-browser-2e35c05f148a823d04b5a0009afd45b3fcd1d3fa.tar.zst
tangerine-wallet-browser-2e35c05f148a823d04b5a0009afd45b3fcd1d3fa.zip
Confirm rejecting multiple transactions with modal
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.js45
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..84b13cffb
--- /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('reject')}
+ cancelText={t('cancel')}
+ submitType="secondary"
+ >
+ <div>
+ <div className="reject-transactions__description">
+ { t('rejectTxsDescription', [unapprovedTxCount]) }
+ </div>
+ </div>
+ </Modal>
+ )
+ }
+}