chore: snapshot before performance optimization

This commit is contained in:
Sepehr Ramezani
2026-04-17 21:14:43 +02:00
parent b6a548acd8
commit 2eceb32fd4
95 changed files with 4357 additions and 1942 deletions

View File

@@ -6,7 +6,6 @@ import { SessionProviderWrapper } from "@/components/session-provider-wrapper";
import { getAISettings } from "@/app/actions/ai-settings";
import { getUserSettings } from "@/app/actions/user-settings";
import { ThemeInitializer } from "@/components/theme-initializer";
import { getThemeScript } from "@/lib/theme-script";
import { auth } from "@/auth";
const inter = Inter({
@@ -32,6 +31,12 @@ export const viewport: Viewport = {
themeColor: "#f59e0b",
};
function getHtmlClass(theme?: string): string {
if (theme === 'dark') return 'dark';
if (theme === 'midnight') return 'dark';
return '';
}
export default async function RootLayout({
children,
}: Readonly<{
@@ -46,16 +51,9 @@ export default async function RootLayout({
getUserSettings(userId)
])
return (
<html suppressHydrationWarning>
<html suppressHydrationWarning className={getHtmlClass(userSettings.theme)}>
<body className={inter.className}>
<script
dangerouslySetInnerHTML={{
__html: getThemeScript(userSettings.theme),
}}
/>
<SessionProviderWrapper>
<ThemeInitializer theme={userSettings.theme} fontSize={aiSettings.fontSize} />
{children}