MCPcopy Create free account
hub / github.com/dailydotdev/apps / DndBanner

Function DndBanner

packages/shared/src/components/DndBanner.tsx:13–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11 * extension-local, so a webapp Resume click can't reach it anyway.
12 */
13export const DndBanner = (): ReactElement => {
14 const { onDndSettings } = useDndContext();
15
16 // The strict signature requires a DndSettings object, but the underlying
17 // `usePersistentContext('dnd')` mutation accepts null at runtime to clear
18 // the IDB key. Match the same call site pattern used elsewhere.
19 const turnOff = () =>
20 (onDndSettings as unknown as (s: null) => Promise<void>)?.(null);
21
22 return (
23 <div className="relative z-popup flex w-full flex-col items-start bg-accent-onion-default py-3 pl-3 pr-12 typo-footnote laptop:fixed laptop:h-8 laptop:flex-row laptop:items-center laptop:justify-center laptop:p-0">
24 <strong>daily.dev in a new tab is paused</strong>
25 <Button
26 size={ButtonSize.XSmall}
27 variant={ButtonVariant.Primary}
28 className="mt-2 laptop:ml-4 laptop:mt-0"
29 onClick={turnOff}
30 >
31 Unpause
32 </Button>
33 <Button
34 size={ButtonSize.XSmall}
35 variant={ButtonVariant.Tertiary}
36 className="absolute right-2 top-2 laptop:inset-y-0 laptop:my-auto"
37 icon={<XIcon />}
38 onClick={turnOff}
39 />
40 </div>
41 );
42};
43
44export default DndBanner;

Callers

nothing calls this directly

Calls 1

useDndContextFunction · 0.90

Tested by

no test coverage detected