You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.1 KiB
46 lines
1.1 KiB
4 years ago
|
import PropTypes from 'prop-types';
|
||
|
import React, { PureComponent } from 'react';
|
||
|
import Modal from '../../modal';
|
||
6 years ago
|
|
||
|
export default class RejectTransactionsModal extends PureComponent {
|
||
|
static contextTypes = {
|
||
|
t: PropTypes.func.isRequired,
|
||
4 years ago
|
};
|
||
6 years ago
|
|
||
|
static propTypes = {
|
||
|
onSubmit: PropTypes.func.isRequired,
|
||
|
hideModal: PropTypes.func.isRequired,
|
||
|
unapprovedTxCount: PropTypes.number.isRequired,
|
||
4 years ago
|
};
|
||
6 years ago
|
|
||
|
onSubmit = async () => {
|
||
4 years ago
|
const { onSubmit, hideModal } = this.props;
|
||
6 years ago
|
|
||
4 years ago
|
await onSubmit();
|
||
|
hideModal();
|
||
|
};
|
||
6 years ago
|
|
||
4 years ago
|
render() {
|
||
4 years ago
|
const { t } = this.context;
|
||
|
const { hideModal, unapprovedTxCount } = this.props;
|
||
6 years ago
|
|
||
|
return (
|
||
|
<Modal
|
||
|
headerText={t('rejectTxsN', [unapprovedTxCount])}
|
||
|
onClose={hideModal}
|
||
|
onSubmit={this.onSubmit}
|
||
|
onCancel={hideModal}
|
||
6 years ago
|
submitText={t('rejectAll')}
|
||
6 years ago
|
cancelText={t('cancel')}
|
||
|
submitType="secondary"
|
||
|
>
|
||
|
<div>
|
||
|
<div className="reject-transactions__description">
|
||
4 years ago
|
{t('rejectTxsDescription', [unapprovedTxCount])}
|
||
6 years ago
|
</div>
|
||
|
</div>
|
||
|
</Modal>
|
||
4 years ago
|
);
|
||
6 years ago
|
}
|
||
|
}
|