2022-12-03 04:14:27 +01:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { useI18nContext } from '../../../hooks/useI18nContext';
|
|
|
|
|
|
|
|
import Popover from '../../ui/popover';
|
|
|
|
import Box from '../../ui/box';
|
|
|
|
import Button from '../../ui/button';
|
|
|
|
import {
|
2023-06-08 01:19:32 +02:00
|
|
|
Display,
|
|
|
|
FlexDirection,
|
|
|
|
FontWeight,
|
2023-02-02 21:15:26 +01:00
|
|
|
JustifyContent,
|
2023-03-16 01:00:54 +01:00
|
|
|
TextVariant,
|
2023-02-02 21:15:26 +01:00
|
|
|
AlignItems,
|
2023-02-23 22:20:07 +01:00
|
|
|
IconColor,
|
2022-12-03 04:14:27 +01:00
|
|
|
} from '../../../helpers/constants/design-system';
|
2023-04-19 23:16:49 +02:00
|
|
|
import { Icon, IconName, IconSize, Text } from '../../component-library';
|
2022-12-03 04:14:27 +01:00
|
|
|
|
|
|
|
const ConfirmationWarningModal = ({ onSubmit, onCancel }) => {
|
|
|
|
const t = useI18nContext();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Popover
|
|
|
|
className="confirmation-warning-modal__content"
|
|
|
|
footer={
|
|
|
|
<Box
|
2023-06-08 01:19:32 +02:00
|
|
|
display={Display.Flex}
|
|
|
|
flexDirection={FlexDirection.Column}
|
2023-02-02 21:15:26 +01:00
|
|
|
justifyContent={JustifyContent.spaceBetween}
|
2022-12-03 04:14:27 +01:00
|
|
|
className="confirmation-warning-modal__footer"
|
|
|
|
>
|
|
|
|
<Button
|
|
|
|
className="confirmation-warning-modal__footer__approve-button"
|
|
|
|
type="danger-primary"
|
|
|
|
onClick={onSubmit}
|
|
|
|
>
|
|
|
|
{t('approveButtonText')}
|
|
|
|
</Button>
|
|
|
|
<Button
|
|
|
|
className="confirmation-warning-modal__footer__cancel-button"
|
|
|
|
type="secondary"
|
|
|
|
onClick={onCancel}
|
|
|
|
>
|
|
|
|
{t('reject')}
|
|
|
|
</Button>
|
|
|
|
</Box>
|
|
|
|
}
|
|
|
|
>
|
|
|
|
<Box
|
2023-06-08 01:19:32 +02:00
|
|
|
display={Display.Flex}
|
|
|
|
flexDirection={FlexDirection.Row}
|
2023-02-02 21:15:26 +01:00
|
|
|
alignItems={AlignItems.center}
|
2022-12-03 04:14:27 +01:00
|
|
|
padding={3}
|
|
|
|
margin={0}
|
|
|
|
className="confirmation-warning-modal__content__header"
|
|
|
|
>
|
2023-02-23 22:20:07 +01:00
|
|
|
<Icon
|
2023-04-19 23:16:49 +02:00
|
|
|
name={IconName.Danger}
|
2023-02-23 22:20:07 +01:00
|
|
|
color={IconColor.errorDefault}
|
|
|
|
className="confirmation-warning-modal__content__header__warning-icon"
|
2023-04-19 23:16:49 +02:00
|
|
|
size={IconSize.Xl}
|
2023-02-23 22:20:07 +01:00
|
|
|
/>
|
2023-03-16 01:00:54 +01:00
|
|
|
<Text
|
|
|
|
variant={TextVariant.headingSm}
|
|
|
|
as="h4"
|
2023-06-08 01:19:32 +02:00
|
|
|
fontWeight={FontWeight.Bold}
|
2023-02-02 21:15:26 +01:00
|
|
|
>
|
2022-12-03 04:14:27 +01:00
|
|
|
{t('addEthereumChainWarningModalTitle')}
|
2023-03-16 01:00:54 +01:00
|
|
|
</Text>
|
2022-12-03 04:14:27 +01:00
|
|
|
</Box>
|
|
|
|
<Box marginLeft={6} marginRight={6} marginTop={0} marginBottom={3}>
|
2023-03-16 01:00:54 +01:00
|
|
|
<Text marginTop={4} variant={TextVariant.bodySm} as="h6">
|
2022-12-03 04:14:27 +01:00
|
|
|
{t('addEthereumChainWarningModalHeader', [
|
|
|
|
<strong key="part-2">
|
|
|
|
{t('addEthereumChainWarningModalHeaderPartTwo')}
|
|
|
|
</strong>,
|
|
|
|
])}
|
2023-03-16 01:00:54 +01:00
|
|
|
</Text>
|
|
|
|
<Text marginTop={4} variant={TextVariant.bodySm} as="h6">
|
2022-12-03 04:14:27 +01:00
|
|
|
{t('addEthereumChainWarningModalListHeader')}
|
2023-03-16 01:00:54 +01:00
|
|
|
</Text>
|
2022-12-03 04:14:27 +01:00
|
|
|
<ul>
|
|
|
|
<li>
|
2023-03-16 01:00:54 +01:00
|
|
|
<Text marginTop={2} variant={TextVariant.bodySm} as="h6">
|
2022-12-03 04:14:27 +01:00
|
|
|
{t('addEthereumChainWarningModalListPointOne')}
|
2023-03-16 01:00:54 +01:00
|
|
|
</Text>
|
2022-12-03 04:14:27 +01:00
|
|
|
</li>
|
|
|
|
<li>
|
2023-03-16 01:00:54 +01:00
|
|
|
<Text marginTop={2} variant={TextVariant.bodySm} as="h6">
|
2022-12-03 04:14:27 +01:00
|
|
|
{t('addEthereumChainWarningModalListPointTwo')}
|
2023-03-16 01:00:54 +01:00
|
|
|
</Text>
|
2022-12-03 04:14:27 +01:00
|
|
|
</li>
|
|
|
|
<li>
|
2023-03-16 01:00:54 +01:00
|
|
|
<Text marginTop={2} variant={TextVariant.bodySm} as="h6">
|
2022-12-03 04:14:27 +01:00
|
|
|
{t('addEthereumChainWarningModalListPointThree')}
|
2023-03-16 01:00:54 +01:00
|
|
|
</Text>
|
2022-12-03 04:14:27 +01:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</Box>
|
|
|
|
</Popover>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
ConfirmationWarningModal.propTypes = {
|
|
|
|
/**
|
|
|
|
* Function that approves collection
|
|
|
|
*/
|
|
|
|
onSubmit: PropTypes.func,
|
|
|
|
/**
|
|
|
|
* Function that rejects collection
|
|
|
|
*/
|
|
|
|
onCancel: PropTypes.func,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ConfirmationWarningModal;
|