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

Function Sidebar

packages/shared/src/components/sidebar/Sidebar.tsx:34–82  ·  view source on GitHub ↗
({
  additionalButtons,
  isNavButtons,
  showFeedbackWidget,
  onNavTabClick,
  onLogoClick,
  activePage,
}: SidebarProps)

Source from the content-addressed store, hash-verified

32}
33
34export const Sidebar = ({
35 additionalButtons,
36 isNavButtons,
37 showFeedbackWidget,
38 onNavTabClick,
39 onLogoClick,
40 activePage,
41}: SidebarProps): ReactElement | null => {
42 const isLaptop = useViewSize(ViewSize.Laptop);
43 const isTablet = useViewSize(ViewSize.Tablet);
44 const featureTheme = useFeatureTheme();
45 const { isV2 } = useLayoutVariant();
46
47 if (!isLaptop && isTablet) {
48 return (
49 <SidebarTablet
50 activePage={activePage}
51 onLogoClick={onLogoClick}
52 featureTheme={featureTheme}
53 />
54 );
55 }
56
57 if (isLaptop) {
58 if (isV2) {
59 return (
60 <SidebarDesktopV2
61 activePage={isExtension ? activePage : undefined}
62 featureTheme={featureTheme}
63 additionalButtons={additionalButtons}
64 isNavButtons={isNavButtons}
65 showFeedbackWidget={showFeedbackWidget}
66 onNavTabClick={onNavTabClick}
67 onLogoClick={onLogoClick}
68 />
69 );
70 }
71 return (
72 <SidebarDesktop
73 activePage={isExtension ? activePage : undefined}
74 featureTheme={featureTheme}
75 isNavButtons={isNavButtons}
76 onNavTabClick={onNavTabClick}
77 />
78 );
79 }
80
81 return null;
82};

Callers

nothing calls this directly

Calls 3

useViewSizeFunction · 0.90
useFeatureThemeFunction · 0.90
useLayoutVariantFunction · 0.90

Tested by

no test coverage detected