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">
|
2020-11-11 16:38:15 +01:00
|
|
|
<img src="images/check-icon.svg" alt="" />
|
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
|
|
|
}
|
|
|
|
}
|