2021-11-18 19:30:56 +01:00
|
|
|
import React from 'react';
|
2021-12-14 00:41:10 +01:00
|
|
|
import { useHistory } from 'react-router-dom';
|
2021-11-18 19:30:56 +01:00
|
|
|
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';
|
2021-12-14 00:41:10 +01:00
|
|
|
import Button from '../../ui/button';
|
|
|
|
import { EXPERIMENTAL_ROUTE } from '../../../helpers/constants/routes';
|
|
|
|
import { setCollectiblesDetectionNoticeDismissed } from '../../../store/actions';
|
2021-11-18 19:30:56 +01:00
|
|
|
|
2021-12-14 00:41:10 +01:00
|
|
|
export default function CollectiblesDetectionNotice() {
|
2021-11-18 19:30:56 +01:00
|
|
|
const t = useI18nContext();
|
2021-12-14 00:41:10 +01:00
|
|
|
const history = useHistory();
|
2021-11-18 19:30:56 +01:00
|
|
|
|
|
|
|
return (
|
2022-03-31 16:02:47 +02:00
|
|
|
<Box className="collectibles-detection-notice">
|
2021-12-14 00:41:10 +01:00
|
|
|
<Dialog type="message" className="collectibles-detection-notice__message">
|
|
|
|
<button
|
|
|
|
onClick={() => setCollectiblesDetectionNoticeDismissed()}
|
2022-03-31 16:02:47 +02:00
|
|
|
className="fas fa-times collectibles-detection-notice__message__close-button"
|
2021-12-14 00:41:10 +01:00
|
|
|
data-testid="collectibles-detection-notice-close"
|
|
|
|
/>
|
2021-11-18 19:30:56 +01:00
|
|
|
<Box display={DISPLAY.FLEX}>
|
2022-03-31 16:02:47 +02:00
|
|
|
<Box paddingTop={1}>
|
|
|
|
<i
|
|
|
|
style={{
|
|
|
|
fontSize: '1rem',
|
|
|
|
color: 'var(--color-primary-default)',
|
|
|
|
}}
|
|
|
|
className="fa fa-info-circle"
|
|
|
|
/>
|
2021-11-18 19:30:56 +01:00
|
|
|
</Box>
|
2022-03-31 16:02:47 +02:00
|
|
|
<Box paddingLeft={2}>
|
2021-11-18 19:30:56 +01:00
|
|
|
<Typography
|
2022-03-09 16:24:53 +01:00
|
|
|
color={COLORS.TEXT_DEFAULT}
|
2021-11-18 19:30:56 +01:00
|
|
|
align={TEXT_ALIGN.LEFT}
|
2022-03-31 16:02:47 +02:00
|
|
|
variant={TYPOGRAPHY.H7}
|
2021-11-18 19:30:56 +01:00
|
|
|
fontWeight={FONT_WEIGHT.BOLD}
|
|
|
|
>
|
|
|
|
{t('newNFTsDetected')}
|
|
|
|
</Typography>
|
|
|
|
<Typography
|
2022-03-09 16:24:53 +01:00
|
|
|
color={COLORS.TEXT_DEFAULT}
|
2021-11-18 19:30:56 +01:00
|
|
|
align={TEXT_ALIGN.LEFT}
|
2022-03-31 16:02:47 +02:00
|
|
|
variant={TYPOGRAPHY.H7}
|
2021-11-18 19:30:56 +01:00
|
|
|
boxProps={{ marginBottom: 4 }}
|
|
|
|
>
|
2022-03-31 16:02:47 +02:00
|
|
|
{t('newNFTDetectedMessage')}
|
2021-11-18 19:30:56 +01:00
|
|
|
</Typography>
|
2021-12-14 00:41:10 +01:00
|
|
|
<Button
|
|
|
|
type="link"
|
2022-07-18 16:43:30 +02:00
|
|
|
onClick={(e) => {
|
|
|
|
e.preventDefault();
|
|
|
|
history.push(`${EXPERIMENTAL_ROUTE}#autodetect-nfts`);
|
2021-11-18 19:30:56 +01:00
|
|
|
}}
|
2021-12-14 00:41:10 +01:00
|
|
|
className="collectibles-detection-notice__message__link"
|
2021-11-18 19:30:56 +01:00
|
|
|
>
|
|
|
|
{t('selectNFTPrivacyPreference')}
|
2021-12-14 00:41:10 +01:00
|
|
|
</Button>
|
2021-11-18 19:30:56 +01:00
|
|
|
</Box>
|
|
|
|
</Box>
|
|
|
|
</Dialog>
|
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
}
|