Move mantine provider to inside dashboard/ path
This commit is contained in:
parent
16953fb53c
commit
b881b1383f
|
|
@ -1,4 +1,4 @@
|
|||
import { AppShell, AppShellHeader, Burger } from "@mantine/core";
|
||||
import { AppShell, AppShellHeader, Burger, MantineProvider } from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import Image from "next/image";
|
||||
import React from "react";
|
||||
|
|
@ -6,6 +6,7 @@ import logo from "@/assets/logos/logo.png";
|
|||
import DashboardLayout from "@/modules/dashboard/components/DashboardLayout";
|
||||
import getUser from "@/modules/auth/actions/getUser";
|
||||
import { redirect } from "next/navigation";
|
||||
import { Notifications } from "@mantine/notifications";
|
||||
|
||||
interface Props {
|
||||
children: React.ReactNode;
|
||||
|
|
@ -18,5 +19,10 @@ export default async function Layout(props: Props) {
|
|||
redirect("/login");
|
||||
}
|
||||
|
||||
return <DashboardLayout>{props.children}</DashboardLayout>;
|
||||
return (
|
||||
<MantineProvider>
|
||||
<Notifications />
|
||||
<DashboardLayout>{props.children}</DashboardLayout>
|
||||
</MantineProvider>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@ import "./globals.css";
|
|||
import "@mantine/core/styles.css";
|
||||
import '@mantine/notifications/styles.css';
|
||||
|
||||
import { ColorSchemeScript, MantineProvider } from "@mantine/core";
|
||||
import { Notifications } from "@mantine/notifications";
|
||||
import { ColorSchemeScript } from "@mantine/core";
|
||||
import { AuthContextProvider } from "@/modules/auth/contexts/AuthContext";
|
||||
|
||||
const inter = Inter({ subsets: ["latin"] });
|
||||
|
|
@ -27,10 +26,7 @@ export default function RootLayout({
|
|||
<ColorSchemeScript />
|
||||
</head>
|
||||
<body className={inter.className}>
|
||||
<MantineProvider>
|
||||
<Notifications />
|
||||
<AuthContextProvider>{children}</AuthContextProvider>
|
||||
</MantineProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user