1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-29 15:50:28 +01:00
metamask-extension/ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.js
Harsh Shukla a6d7c436bc
Part of #17670 for file: detected-token-ignored-popover.js (#18738)
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
2023-04-26 10:25:18 -05:00

74 lines
1.9 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { useI18nContext } from '../../../../hooks/useI18nContext';
import Popover from '../../../ui/popover';
import Button from '../../../ui/button';
import { TextVariant } from '../../../../helpers/constants/design-system';
import { Text } from '../../../component-library';
const DetectedTokenIgnoredPopover = ({
partiallyIgnoreDetectedTokens,
onCancelIgnore,
handleClearTokensSelection,
}) => {
const t = useI18nContext();
const footer = (
<>
<Button
className="detected-token-ignored-popover__ignore-button"
type="secondary"
onClick={onCancelIgnore}
>
{t('cancel')}
</Button>
<Button
className="detected-token-ignored-popover__import-button"
type="primary"
onClick={handleClearTokensSelection}
>
{t('confirm')}
</Button>
</>
);
return (
<Popover
title={
partiallyIgnoreDetectedTokens
? t('importSelectedTokens')
: t('areYouSure')
}
className={classNames('detected-token-ignored-popover', {
'detected-token-ignored-popover--import': partiallyIgnoreDetectedTokens,
'detected-token-ignored-popover--ignore':
!partiallyIgnoreDetectedTokens,
})}
footer={footer}
>
<Text
variant={TextVariant.bodySm}
as="h6"
marginTop={0}
marginRight={5}
marginBottom={7}
marginLeft={5}
>
{partiallyIgnoreDetectedTokens
? t('importSelectedTokensDescription')
: t('ignoreTokenWarning')}
</Text>
</Popover>
);
};
DetectedTokenIgnoredPopover.propTypes = {
partiallyIgnoreDetectedTokens: PropTypes.bool.isRequired,
onCancelIgnore: PropTypes.func.isRequired,
handleClearTokensSelection: PropTypes.func.isRequired,
};
export default DetectedTokenIgnoredPopover;