Better ui and slight change for settings #3
This commit is contained in:
+8
-2
@@ -1,6 +1,8 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import { cookies } from "next/headers";
|
||||
import { parseClientSettings } from "@/lib/clientSettings";
|
||||
|
||||
const geistSans = Geist({
|
||||
variable: "--font-geist-sans",
|
||||
@@ -17,15 +19,19 @@ export const metadata: Metadata = {
|
||||
description: "Generated by create next app",
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
export default async function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
const cookieStore = await cookies();
|
||||
|
||||
const settings = parseClientSettings(cookieStore.get("settings")?.value);
|
||||
|
||||
return (
|
||||
<html lang="en">
|
||||
<body
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased dark`}
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased ${settings.theme}`}
|
||||
>
|
||||
{children}
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user