fix: move AuthProvider to layout for (auth)

This commit is contained in:
Dorian Niemiec 2024-09-07 09:03:40 +02:00
parent dc04c22933
commit 2f22fb5b37
2 changed files with 18 additions and 6 deletions

14
app/(auth)/layout.tsx Normal file
View file

@ -0,0 +1,14 @@
import React from "react";
import AuthProvider from "../../components/shared/providers/AuthProvider";
export default function AdminLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<AuthProvider>
{children}
</AuthProvider>
);
}

View file

@ -2,7 +2,6 @@ import type { Metadata } from "next";
import { Poppins } from "next/font/google";
import "./globals.css";
import { ThemeProvider } from "@/components/shared/providers/themeprovider";
import AuthProvider from "@/components/shared/providers/AuthProvider";
import { Toaster } from "@/components/ui/toaster";
import { Analytics } from "@vercel/analytics/react";
@ -55,11 +54,10 @@ export default function RootLayout({
enableSystem
disableTransitionOnChange
>
<AuthProvider>
{children}
<Toaster />
<Analytics />
</AuthProvider>
{children}
<Toaster />
<Analytics />
</ThemeProvider>
</body>
</html>