All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 1m6s
The app was crashing with "useTheme must be used within ThemeProvider" error during server-side rendering. Changes: - Created AppLayout client component to wrap Navbar - Modified useTheme hook to return default values during SSR instead of throwing an error - Updated Navbar to safely handle theme context - Moved Navbar rendering into client-side only AppLayout This fixes the SSR hydration mismatch and allows the app to render correctly on both server and client. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
53 lines
1.5 KiB
TypeScript
53 lines
1.5 KiB
TypeScript
import type { Metadata } from 'next';
|
|
import { Inter } from 'next/font/google';
|
|
import './globals.css';
|
|
import { Providers } from '@/components/providers/Providers';
|
|
import { AppLayout } from '@/components/layout/AppLayout';
|
|
|
|
const inter = Inter({
|
|
subsets: ['latin'],
|
|
variable: '--font-inter',
|
|
});
|
|
|
|
export const metadata: Metadata = {
|
|
title: 'Supervisor UI',
|
|
description: 'Modern web interface for Supervisor process management',
|
|
};
|
|
|
|
// Force dynamic rendering
|
|
export const dynamic = 'force-dynamic';
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode;
|
|
}>) {
|
|
return (
|
|
<html lang="en" suppressHydrationWarning>
|
|
<head>
|
|
<script
|
|
dangerouslySetInnerHTML={{
|
|
__html: `
|
|
(function() {
|
|
try {
|
|
const theme = localStorage.getItem('theme') || 'system';
|
|
const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
const effectiveTheme = theme === 'system' ? systemTheme : theme;
|
|
if (effectiveTheme === 'dark') {
|
|
document.documentElement.classList.add('dark');
|
|
}
|
|
} catch (e) {}
|
|
})();
|
|
`,
|
|
}}
|
|
/>
|
|
</head>
|
|
<body className={`${inter.variable} antialiased`}>
|
|
<Providers>
|
|
<AppLayout>{children}</AppLayout>
|
|
</Providers>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|