mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-01 21:57:06 +01:00
05a20bb721
* Adding responsive props to Box component * Updating margin array prop instances * Updating padding array prop instances * Updates to docs, tests and margin, padding instances * Optimizing class name object * Simplifying single value logic * replacing for loop with switch statement * Memoizing generateClassNames function
61 lines
1.4 KiB
JavaScript
61 lines
1.4 KiB
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { useI18nContext } from '../../../../hooks/useI18nContext';
|
|
|
|
import Popover from '../../../ui/popover';
|
|
import Button from '../../../ui/button';
|
|
import Typography from '../../../ui/typography/typography';
|
|
import { TYPOGRAPHY } from '../../../../helpers/constants/design-system';
|
|
|
|
const DetectedTokenIgnoredPopover = ({
|
|
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={t('areYouSure')}
|
|
className="detected-token-ignored-popover"
|
|
footer={footer}
|
|
>
|
|
<Typography
|
|
variant={TYPOGRAPHY.H6}
|
|
tag={TYPOGRAPHY.H6}
|
|
marginTop={0}
|
|
marginRight={5}
|
|
marginBottom={7}
|
|
marginLeft={5}
|
|
>
|
|
{t('ignoreTokenWarning')}
|
|
</Typography>
|
|
</Popover>
|
|
);
|
|
};
|
|
|
|
DetectedTokenIgnoredPopover.propTypes = {
|
|
onCancelIgnore: PropTypes.func.isRequired,
|
|
handleClearTokensSelection: PropTypes.func.isRequired,
|
|
};
|
|
|
|
export default DetectedTokenIgnoredPopover;
|