2024-04-15 15:00:47 -07:00
|
|
|
import Navbar from "@/components/navbar";
|
2024-04-17 21:31:45 -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-15 19:31:55 -07:00
|
|
|
import { cn } from "@/lib/utils";
|
2024-04-15 15:00:47 -07:00
|
|
|
import ThemeProvider from "@/provider/theme-provider";
|
|
|
|
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-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-17 16:14:40 -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;
|