2021-02-04 19:15:23 +01:00
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import Modal from '../../modal';
|
2023-04-04 18:48:04 +02:00
|
|
|
import {
|
|
|
|
Icon,
|
|
|
|
ICON_NAMES,
|
|
|
|
ICON_SIZES,
|
|
|
|
} from '../../../component-library/icon/deprecated';
|
2023-02-23 14:19:28 +01:00
|
|
|
import { IconColor } from '../../../../helpers/constants/design-system';
|
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">
|
2023-02-23 14:19:28 +01:00
|
|
|
<Icon
|
|
|
|
name={ICON_NAMES.CHECK}
|
|
|
|
color={IconColor.successDefault}
|
|
|
|
size={ICON_SIZES.XL}
|
2022-03-23 21:35:52 +01:00
|
|
|
/>
|
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
|
|
|
}
|
|
|
|
}
|