({
children,
hiddenCookieId,
}: {
children: ReactNode;
hiddenCookieId: string;
})
| 10 | }); |
| 11 | |
| 12 | export function Popup({ |
| 13 | children, |
| 14 | hiddenCookieId, |
| 15 | }: { |
| 16 | children: ReactNode; |
| 17 | hiddenCookieId: string; |
| 18 | }) { |
| 19 | const [hidden, setHidden] = useState(Cookies.get(hiddenCookieId) === "1"); |
| 20 | const hidePopup = () => { |
| 21 | setHidden(true); |
| 22 | Cookies.set(hiddenCookieId, "1"); |
| 23 | }; |
| 24 | |
| 25 | return ( |
| 26 | <ClientOnly> |
| 27 | <PopupContext.Provider value={{ hidePopup }}> |
| 28 | <AnimatePresence>{!hidden && children}</AnimatePresence> |
| 29 | </PopupContext.Provider> |
| 30 | </ClientOnly> |
| 31 | ); |
| 32 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…