Created
September 25, 2024 01:03
-
-
Save pivcec/c481146cdf5acc7081cdd5df5d3e275b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use client"; // This directive makes the component a client component | |
| import { createPagesBrowserClient } from "@supabase/auth-helpers-nextjs"; | |
| import { SessionContextProvider } from "@supabase/auth-helpers-react"; | |
| import TopNav from "../components/TopNav"; // Import the navigation component | |
| import { useState, ReactNode } from "react"; | |
| export const dynamic = "force-dynamic"; | |
| // Define props type | |
| interface RootLayoutProps { | |
| children: ReactNode; // children can be any valid React node | |
| } | |
| export default function RootLayout({ children }: RootLayoutProps) { | |
| const [supabaseClient] = useState(() => createPagesBrowserClient()); | |
| return ( | |
| <SessionContextProvider supabaseClient={supabaseClient}> | |
| <html lang="en"> | |
| <body> | |
| <TopNav /> | |
| {children} | |
| </body> | |
| </html> | |
| </SessionContextProvider> | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment