Skip to content

Commit

Permalink
move all firebase providers to /admin/layout.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
jackavh committed May 15, 2024
1 parent 70a2694 commit a2163a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 3 additions & 3 deletions frontend/src/app/admin/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { usePathname } from "next/navigation";

import { MyFirebaseProvider } from "./firebase/reactfireProvider";
import { FirebaseProvider } from "./firebase/firebaseProvider";

import HeaderBarSpace from "@/components/HeaderBarSpace";
import NavigationBar from "@/components/NavigationBar";
Expand All @@ -14,12 +14,12 @@ export default function AdminLayout({ children }: { children: React.ReactNode })
const isLoginPage = pathname === "/admin";

return (
<MyFirebaseProvider>
<FirebaseProvider>
<section>
{!isLoginPage && <NavigationBar />}
{!isLoginPage && <HeaderBarSpace />}
{children}
</section>
</MyFirebaseProvider>
</FirebaseProvider>
);
}
6 changes: 1 addition & 5 deletions frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Inter, Open_Sans, Roboto_Slab } from "next/font/google";

import { FirebaseProvider } from "./admin/firebase/firebaseProvider";

import type { Metadata } from "next";

export const metadata: Metadata = {
Expand All @@ -28,9 +26,7 @@ const robotoSlab = Roboto_Slab({
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en" className={`${openSans.variable} ${inter.variable} ${robotoSlab.variable}`}>
<body>
<FirebaseProvider>{children}</FirebaseProvider>
</body>
<body>{children}</body>
</html>
);
}

0 comments on commit a2163a4

Please sign in to comment.