keyboard radiogroup, modal focus trap, nav session hydration
All checks were successful
Build and Push / build (push) Successful in 1m53s
All checks were successful
Build and Push / build (push) Successful in 1m53s
This commit is contained in:
@@ -6,6 +6,7 @@ import { signOut, useSession } from "next-auth/react";
|
||||
import { usePathname } from "@/i18n/navigation";
|
||||
import { Link } from "@/i18n/navigation";
|
||||
import { SessionProvider } from "next-auth/react";
|
||||
import type { Session } from "next-auth";
|
||||
import { LanguageSwitcher } from "@/components/ui/language-switcher";
|
||||
|
||||
function NavBar() {
|
||||
@@ -211,9 +212,19 @@ function NavLink({
|
||||
);
|
||||
}
|
||||
|
||||
export function NavShell({ children }: { children: React.ReactNode }) {
|
||||
export function NavShell({
|
||||
children,
|
||||
session,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
// Server-resolved session passed down from the locale layout. Seeding
|
||||
// SessionProvider with it means useSession() is populated on the first
|
||||
// client render, so the nav links render immediately instead of
|
||||
// popping in after the client-side session fetch (CLS / flash).
|
||||
session: Session | null;
|
||||
}) {
|
||||
return (
|
||||
<SessionProvider>
|
||||
<SessionProvider session={session}>
|
||||
<NavBar />
|
||||
<main className="mx-auto max-w-6xl px-5 py-8">{children}</main>
|
||||
</SessionProvider>
|
||||
|
||||
Reference in New Issue
Block a user