MCPcopy
hub / github.com/dubinc/dub / Popup

Function Popup

packages/ui/src/popup.tsx:12–32  ·  view source on GitHub ↗
({
  children,
  hiddenCookieId,
}: {
  children: ReactNode;
  hiddenCookieId: string;
})

Source from the content-addressed store, hash-verified

10});
11
12export 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}

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…