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 { useDisclosure } from "@mantine/hooks";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
@ -6,6 +6,7 @@ import logo from "@/assets/logos/logo.png";
|
||||||
import DashboardLayout from "@/modules/dashboard/components/DashboardLayout";
|
import DashboardLayout from "@/modules/dashboard/components/DashboardLayout";
|
||||||
import getUser from "@/modules/auth/actions/getUser";
|
import getUser from "@/modules/auth/actions/getUser";
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
|
import { Notifications } from "@mantine/notifications";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
|
|
@ -18,5 +19,10 @@ export default async function Layout(props: Props) {
|
||||||
redirect("/login");
|
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/core/styles.css";
|
||||||
import '@mantine/notifications/styles.css';
|
import '@mantine/notifications/styles.css';
|
||||||
|
|
||||||
import { ColorSchemeScript, MantineProvider } from "@mantine/core";
|
import { ColorSchemeScript } from "@mantine/core";
|
||||||
import { Notifications } from "@mantine/notifications";
|
|
||||||
import { AuthContextProvider } from "@/modules/auth/contexts/AuthContext";
|
import { AuthContextProvider } from "@/modules/auth/contexts/AuthContext";
|
||||||
|
|
||||||
const inter = Inter({ subsets: ["latin"] });
|
const inter = Inter({ subsets: ["latin"] });
|
||||||
|
|
@ -27,10 +26,7 @@ export default function RootLayout({
|
||||||
<ColorSchemeScript />
|
<ColorSchemeScript />
|
||||||
</head>
|
</head>
|
||||||
<body className={inter.className}>
|
<body className={inter.className}>
|
||||||
<MantineProvider>
|
|
||||||
<Notifications />
|
|
||||||
<AuthContextProvider>{children}</AuthContextProvider>
|
<AuthContextProvider>{children}</AuthContextProvider>
|
||||||
</MantineProvider>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user