import React, { useContext } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { useHistory } from 'react-router-dom'; import { I18nContext } from '../../../contexts/i18n'; import Popover from '../../ui/popover'; import { DISPLAY, FLEX_DIRECTION, FONT_WEIGHT, TextColor, TextVariant, } from '../../../helpers/constants/design-system'; import Button from '../../ui/button'; import Box from '../../ui/box'; import { setOpenSeaTransactionSecurityProviderPopoverHasBeenShown, setTransactionSecurityCheckEnabled, } from '../../../store/actions'; import { getHasTheOpenSeaTransactionSecurityProviderPopoverBeenShown } from '../../../selectors'; import { Text } from '../../component-library'; import { EXPERIMENTAL_ROUTE } from '../../../helpers/constants/routes'; export default function OpenSeaWhatsNewPopover() { const t = useContext(I18nContext); const dispatch = useDispatch(); const history = useHistory(); const hasThePopoverBeenShown = useSelector( getHasTheOpenSeaTransactionSecurityProviderPopoverBeenShown, ); return ( process.env.TRANSACTION_SECURITY_PROVIDER && !hasThePopoverBeenShown && ( {t('staySafeWithOpenSea')} } footer={ <> } footerClassName="smart-transactions-popover__footer" className="smart-transactions-popover" onClose={() => dispatch(setOpenSeaTransactionSecurityProviderPopoverHasBeenShown()) } > {t('openSeaAltText')} {t('getWarningsFromOpenSea')} {t('openSeaDescription')} {t('alwaysBeSureTo')} ) ); }