RESTfulMC/Frontend/src/app/layout.tsx

82 lines
2.9 KiB
TypeScript
Raw Normal View History

2024-04-26 16:56:07 -07:00
/*
* MIT License
*
* Copyright (c) 2024 Braydon (Rainnny).
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
2024-04-18 17:12:25 -07:00
import Footer from "@/components/footer";
2024-04-15 15:00:47 -07:00
import Navbar from "@/components/navbar";
2024-04-18 17:12:25 -07:00
import { Toaster } from "@/components/ui/sonner";
2024-04-15 15:00:47 -07:00
import { TooltipProvider } from "@/components/ui/tooltip";
import config from "@/config";
2024-04-16 06:59:20 -07:00
import { notoSans } from "@/font/fonts";
2024-04-19 22:33:33 -07:00
import { cn } from "@/app/common/utils";
2024-04-15 15:00:47 -07:00
import type { Metadata, Viewport } from "next";
import PlausibleProvider from "next-plausible";
2024-04-17 16:14:10 -07:00
import { ReactElement, ReactNode } from "react";
2024-04-17 21:04:33 -07:00
import "./globals.css";
2024-04-18 17:12:25 -07:00
import ThemeProvider from "@/provider/theme-provider";
2024-04-15 15:00:47 -07:00
/**
* Site metadata & viewport.
*/
export const metadata: Metadata = config.metadata;
export const viewport: Viewport = config.viewport;
/**
* The root layout for this site.
*
* @param children the children of this layout
* @returns the layout jsx
*/
const RootLayout = ({
2024-04-17 16:06:02 -07:00
children,
2024-04-15 15:00:47 -07:00
}: Readonly<{
2024-04-17 16:14:10 -07:00
children: ReactNode;
2024-04-17 16:06:02 -07:00
}>): ReactElement => {
const analyticsDomain: string | undefined = config.analyticsDomain;
return (
<html lang="en" className={cn("scroll-smooth", notoSans.className)}>
<head>
{analyticsDomain && (
<PlausibleProvider
domain={analyticsDomain}
customDomain="https://analytics.rainnny.club"
selfHosted
/>
)}
</head>
<body className="relative min-h-screen">
<ThemeProvider attribute="class" defaultTheme="dark">
<TooltipProvider>
<Navbar />
{children}
2024-04-18 17:12:25 -07:00
<Footer />
2024-04-17 16:06:02 -07:00
</TooltipProvider>
2024-04-17 21:04:33 -07:00
{/* Toasts */}
<Toaster />
2024-04-17 16:06:02 -07:00
</ThemeProvider>
</body>
</html>
);
2024-04-15 15:00:47 -07:00
};
export default RootLayout;