2021-02-04 19:15:23 +01:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
import Modal from '../../modal';
|
2018-09-24 07:07:19 +02:00
|
|
|
|
|
|
|
export default class RejectTransactionsModal extends PureComponent {
|
|
|
|
static contextTypes = {
|
|
|
|
t: PropTypes.func.isRequired,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-09-24 07:07:19 +02:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
onSubmit: PropTypes.func.isRequired,
|
|
|
|
hideModal: PropTypes.func.isRequired,
|
|
|
|
unapprovedTxCount: PropTypes.number.isRequired,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-09-24 07:07:19 +02:00
|
|
|
|
|
|
|
onSubmit = async () => {
|
2021-02-04 19:15:23 +01:00
|
|
|
const { onSubmit, hideModal } = this.props;
|
2018-09-24 07:07:19 +02:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
await onSubmit();
|
|
|
|
hideModal();
|
|
|
|
};
|
2018-09-24 07:07:19 +02:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
render() {
|
2021-02-04 19:15:23 +01:00
|
|
|
const { t } = this.context;
|
|
|
|
const { hideModal, unapprovedTxCount } = this.props;
|
2018-09-24 07:07:19 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Modal
|
|
|
|
headerText={t('rejectTxsN', [unapprovedTxCount])}
|
|
|
|
onClose={hideModal}
|
|
|
|
onSubmit={this.onSubmit}
|
|
|
|
onCancel={hideModal}
|
2018-09-27 21:04:58 +02:00
|
|
|
submitText={t('rejectAll')}
|
2018-09-24 07:07:19 +02:00
|
|
|
cancelText={t('cancel')}
|
|
|
|
submitType="secondary"
|
|
|
|
>
|
|
|
|
<div>
|
|
|
|
<div className="reject-transactions__description">
|
2020-11-03 00:41:28 +01:00
|
|
|
{t('rejectTxsDescription', [unapprovedTxCount])}
|
2018-09-24 07:07:19 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Modal>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2018-09-24 07:07:19 +02:00
|
|
|
}
|
|
|
|
}
|