MCPcopy Create free account
hub / github.com/CodeFox-Repo/codefox / RootLayout

Function RootLayout

frontend/src/components/root/root-layout.tsx:11–30  ·  view source on GitHub ↗
({ children }: RootLayoutProps)

Source from the content-addressed store, hash-verified

9}
10
11export default function RootLayout({ children }: RootLayoutProps) {
12 const { isAuthorized } = useAuthContext();
13 const [showSidebar, setShowSidebar] = useState(false);
14
15 useEffect(() => {
16 setShowSidebar(isAuthorized);
17 }, [isAuthorized]);
18
19 return (
20 <SidebarProvider defaultOpen={false}>
21 {showSidebar ? (
22 <SidebarWrapper isAuthorized={isAuthorized}>{children}</SidebarWrapper>
23 ) : (
24 <div className="min-h-screen flex">
25 <div className="w-full">{children}</div>
26 </div>
27 )}
28 </SidebarProvider>
29 );
30}

Callers

nothing calls this directly

Calls 1

useAuthContextFunction · 0.90

Tested by

no test coverage detected