@@ -6,17 +6,7 @@ import { MobileNav } from "@/components/ui/mobile-nav";
66import { ModeToggle } from "@/components/ui/mode-toggle" ;
77import { UserNav } from "@/components/ui/user-nav" ;
88
9- // import { useRouter } from 'next/navigation'
10- // import { useAuthStore } from "@/lib/providers/auth-store-provider";
11-
129export function SiteHeader ( ) {
13- // This must have "use client" at the top, hooks don't work on server components
14- // or you'll get a very strange runtime error about useAuthStore() not being a function.
15- // const { isLoggedIn } = useAuthStore(
16- // (state) => state,
17- // )
18- // const router = useRouter();
19-
2010 return (
2111 < header className = "sticky top-0 z-50 w-full border-b border-border/40 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60" >
2212 < div className = "flex h-14 pl-4 pt-2 max-w-screen-2xl items-start" >
@@ -28,18 +18,7 @@ export function SiteHeader() {
2818 </ div >
2919 < nav className = "flex items-center" >
3020 < ModeToggle />
31- { /* {isLoggedIn ? ( */ }
3221 < UserNav />
33- { /* ) : ( */ }
34- { /* <> */ }
35- { /* {console.warn("User is not logged in, redirecting to login route.")} */ }
36- { /* TODO: For some reason, this is causing a redirect boundary error / trying to update
37- 2 components (Router) + (SiteHeader) at the same time. I think it has to do with the
38- AuthStoreProvider and the two different layouts.
39- Help: https://reactjs.org/link/setstate-in-render */ }
40- { /* router.push("/login") */ }
41- { /* </> */ }
42- { /* )} */ }
4322 </ nav >
4423 </ div >
4524 </ div >
0 commit comments