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

Function PlusHeader

packages/webapp/components/layouts/PlusLayout/PlusHeader.tsx:13–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11import { useViewSize, ViewSize } from '@dailydotdev/shared/src/hooks';
12
13export const PlusHeader = (): ReactElement | null => {
14 const isMobile = useViewSize(ViewSize.MobileL);
15 const { back, replace, isReady } = useRouter();
16
17 const onBackClick = useCallback(() => {
18 if (window.history?.length > 1) {
19 back();
20 } else {
21 replace(webappUrl);
22 }
23 }, [back, replace]);
24
25 if (!isReady) {
26 return null;
27 }
28
29 return (
30 <header className="flex h-16 w-full items-center justify-center gap-4 border-b border-border-subtlest-tertiary bg-background-default px-4 tablet:bg-transparent laptop:justify-start">
31 <Button
32 variant={isMobile ? ButtonVariant.Tertiary : ButtonVariant.Float}
33 icon={<ArrowIcon className="-rotate-90" />}
34 onClick={onBackClick}
35 className="absolute left-4 laptop:relative laptop:left-0"
36 >
37 {!isMobile ? 'Back' : undefined}
38 </Button>
39 <LogoWithPlus />
40 </header>
41 );
42};

Callers

nothing calls this directly

Calls 4

useViewSizeFunction · 0.90
replaceFunction · 0.85
useRouterFunction · 0.50
backFunction · 0.50

Tested by

no test coverage detected