chore: snapshot before performance optimization
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user