1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 10:30:04 +01:00
metamask-extension/ui/components/app/collectibles-detection-notice/collectibles-detection-notice.js
Alex Donesky f087e501a1
Add modal with directions to re-add token as NFT (#13291)
* Add modal pop for NFTs previously added as tokens - with directions to re-add as NFTs
2022-01-19 12:42:41 -06:00

66 lines
2.1 KiB
JavaScript

import React from 'react';
import { useHistory } from 'react-router-dom';
import Box from '../../ui/box';
import Dialog from '../../ui/dialog';
import Typography from '../../ui/typography/typography';
import {
COLORS,
TYPOGRAPHY,
TEXT_ALIGN,
FONT_WEIGHT,
DISPLAY,
} from '../../../helpers/constants/design-system';
import { useI18nContext } from '../../../hooks/useI18nContext';
import Button from '../../ui/button';
import { EXPERIMENTAL_ROUTE } from '../../../helpers/constants/routes';
import { setCollectiblesDetectionNoticeDismissed } from '../../../store/actions';
export default function CollectiblesDetectionNotice() {
const t = useI18nContext();
const history = useHistory();
return (
<Box marginBottom={4} className="collectibles-detection-notice">
<Dialog type="message" className="collectibles-detection-notice__message">
<button
onClick={() => setCollectiblesDetectionNoticeDismissed()}
className="collectibles-detection-notice__message__close-button"
data-testid="collectibles-detection-notice-close"
/>
<Box display={DISPLAY.FLEX}>
<Box paddingTop={2}>
<i style={{ fontSize: '1rem' }} className="fa fa-info-circle" />
</Box>
<Box paddingLeft={4}>
<Typography
color={COLORS.BLACK}
align={TEXT_ALIGN.LEFT}
variant={TYPOGRAPHY.H6}
fontWeight={FONT_WEIGHT.BOLD}
>
{t('newNFTsDetected')}
</Typography>
<Typography
color={COLORS.BLACK}
align={TEXT_ALIGN.LEFT}
variant={TYPOGRAPHY.H6}
boxProps={{ marginBottom: 4 }}
>
{t('newNFTsDetectedInfo')}
</Typography>
<Button
type="link"
onClick={() => {
history.push(EXPERIMENTAL_ROUTE);
}}
className="collectibles-detection-notice__message__link"
>
{t('selectNFTPrivacyPreference')}
</Button>
</Box>
</Box>
</Dialog>
</Box>
);
}