import { Popover } from 'antd'; import React, { useState, useEffect, FC } from 'react'; import dynamic from 'next/dynamic'; import styles from './NotifyReminderPopup.module.scss'; // Lazy loaded components const CloseOutlined = dynamic(() => import('@ant-design/icons/CloseOutlined'), { ssr: false, }); export type NotifyReminderPopupProps = { open: boolean; children: React.ReactNode; notificationClicked: () => void; notificationClosed: () => void; }; export const NotifyReminderPopup: FC = ({ children, open, notificationClicked, notificationClosed, }) => { const [openPopup, setOpenPopup] = useState(open); const [mounted, setMounted] = useState(false); useEffect(() => { setOpenPopup(open); }, [open]); useEffect(() => { setMounted(true); }, []); const title =
Stay updated!
; const popupStyle = { borderRadius: '5px', cursor: 'pointer', paddingTop: '10px', paddingRight: '10px', fontSize: '14px', }; const popupClicked = e => { e.stopPropagation(); notificationClicked(); }; const popupClosed = e => { e.stopPropagation(); setOpenPopup(false); notificationClosed(); }; const content = (
Click and never miss
future streams!
); return ( mounted && ( node} > {children} ) ); };