1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-05 07:24:56 +01:00
metamask-extension/ui/components/app/modals/reject-transactions/reject-transactions.component.js

46 lines
1.1 KiB
JavaScript
Raw Normal View History

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();
};
2020-11-03 00:41:28 +01:00
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">
2020-11-03 00:41:28 +01:00
{t('rejectTxsDescription', [unapprovedTxCount])}
</div>
</div>
</Modal>
);
}
}