73 lines
1.8 KiB
TypeScript
73 lines
1.8 KiB
TypeScript
import "./globals.css";
|
|
import type { Metadata } from "next";
|
|
import "../app/globals.css";
|
|
import { Arimo, Indie_Flower } from "next/font/google";
|
|
import { ToastContainer } from "react-toastify";
|
|
import "react-toastify/dist/ReactToastify.css";
|
|
import Header from "@/components/Header";
|
|
import { cookies } from "next/headers";
|
|
import { isAuthenticated } from "@/lib/auth";
|
|
import { GTagProvider, PHProvider, ThemeProvider } from "./providers";
|
|
import PrelineScript from "@/components/Utilities/PrelineScript";
|
|
import { title } from "@/constants";
|
|
|
|
const raleway = Arimo({
|
|
variable: "--body-font",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
const arimo = Arimo({
|
|
variable: "--body-font",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
const indieFlower = Indie_Flower({
|
|
variable: "--accent-font",
|
|
weight: "400",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
export const metadata: Metadata = {
|
|
title: title,
|
|
description: title,
|
|
};
|
|
|
|
export default async function RootLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
const isUserLoggedIn = await isAuthenticated(cookies());
|
|
|
|
return (
|
|
<html
|
|
lang="en"
|
|
className={`h-full ${raleway.variable} ${arimo.variable} ${indieFlower.variable}`}
|
|
suppressHydrationWarning
|
|
>
|
|
<PHProvider>
|
|
<GTagProvider />
|
|
<body className={`${arimo.className} bg-base-100 flex`}>
|
|
<ThemeProvider>
|
|
<Header isUserLoggedIn={isUserLoggedIn} />
|
|
{children}
|
|
<ToastContainer
|
|
position="bottom-left"
|
|
autoClose={5000}
|
|
hideProgressBar={false}
|
|
newestOnTop={false}
|
|
closeOnClick
|
|
rtl={false}
|
|
pauseOnFocusLoss
|
|
draggable
|
|
pauseOnHover
|
|
theme="colored"
|
|
/>
|
|
</ThemeProvider>
|
|
</body>
|
|
<PrelineScript />
|
|
</PHProvider>
|
|
</html>
|
|
);
|
|
}
|