1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-30 16:18:07 +01:00
metamask-extension/ui/components/app/modals/transaction-confirmed/transaction-confirmed.component.js
George Marshall 739075662c
Migrating Icon to typescript and deprecating JS component (#18431)
* Migrating Icon to typescript and deprecating JS component

* gw suggestions (#18434)

---------

Co-authored-by: Garrett Bear <gwhisten@gmail.com>
2023-04-04 09:48:04 -07:00

53 lines
1.2 KiB
JavaScript

import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import Modal from '../../modal';
import {
Icon,
ICON_NAMES,
ICON_SIZES,
} from '../../../component-library/icon/deprecated';
import { IconColor } from '../../../../helpers/constants/design-system';
export default class TransactionConfirmed extends PureComponent {
static contextTypes = {
t: PropTypes.func,
};
static propTypes = {
onSubmit: PropTypes.func,
hideModal: PropTypes.func,
};
handleSubmit = () => {
const { hideModal, onSubmit } = this.props;
hideModal();
if (onSubmit && typeof onSubmit === 'function') {
onSubmit();
}
};
render() {
const { t } = this.context;
return (
<Modal onSubmit={this.handleSubmit} submitText={t('ok')}>
<div className="transaction-confirmed__content">
<Icon
name={ICON_NAMES.CHECK}
color={IconColor.successDefault}
size={ICON_SIZES.XL}
/>
<div className="transaction-confirmed__title">
{`${t('confirmed')}!`}
</div>
<div className="transaction-confirmed__description">
{t('initialTransactionConfirmed')}
</div>
</div>
</Modal>
);
}
}