2021-02-04 19:15:23 +01:00
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import Modal from '../../modal';
|
2018-05-29 19:23:06 +02:00
|
|
|
|
2018-09-17 19:34:29 +02:00
|
|
|
export default class TransactionConfirmed extends PureComponent {
|
|
|
|
static contextTypes = {
|
|
|
|
t: PropTypes.func,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-05-29 19:23:06 +02:00
|
|
|
|
2018-09-17 19:34:29 +02:00
|
|
|
static propTypes = {
|
|
|
|
onSubmit: PropTypes.func,
|
|
|
|
hideModal: PropTypes.func,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-05-29 19:23:06 +02:00
|
|
|
|
2018-09-17 19:34:29 +02:00
|
|
|
handleSubmit = () => {
|
2021-02-04 19:15:23 +01:00
|
|
|
const { hideModal, onSubmit } = this.props;
|
2018-09-17 19:34:29 +02:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
hideModal();
|
2018-05-29 19:23:06 +02:00
|
|
|
|
2018-09-17 19:34:29 +02:00
|
|
|
if (onSubmit && typeof onSubmit === 'function') {
|
2021-02-04 19:15:23 +01:00
|
|
|
onSubmit();
|
2018-09-17 19:34:29 +02:00
|
|
|
}
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-09-17 19:34:29 +02:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
render() {
|
2021-02-04 19:15:23 +01:00
|
|
|
const { t } = this.context;
|
2018-09-17 19:34:29 +02:00
|
|
|
|
|
|
|
return (
|
2020-11-03 00:41:28 +01:00
|
|
|
<Modal onSubmit={this.handleSubmit} submitText={t('ok')}>
|
2018-09-17 19:34:29 +02:00
|
|
|
<div className="transaction-confirmed__content">
|
2022-03-23 21:35:52 +01:00
|
|
|
<i
|
|
|
|
className="fa fa-check-circle fa-3x"
|
|
|
|
style={{ color: 'var(--color-success-default)' }}
|
|
|
|
/>
|
2018-09-17 19:34:29 +02:00
|
|
|
<div className="transaction-confirmed__title">
|
2020-11-03 00:41:28 +01:00
|
|
|
{`${t('confirmed')}!`}
|
2018-09-17 19:34:29 +02:00
|
|
|
</div>
|
|
|
|
<div className="transaction-confirmed__description">
|
2020-11-03 00:41:28 +01:00
|
|
|
{t('initialTransactionConfirmed')}
|
2018-09-17 19:34:29 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Modal>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2018-09-17 19:34:29 +02:00
|
|
|
}
|
|
|
|
}
|