I incorrectly removed next-themes thinking it caused the hydration warning. The actual mismatch was a `__gcrremoteframetoken` attribute added to <html> by a browser extension, which the previous commit already addressed via `suppressHydrationWarning`. Restored: - ThemeProvider wrap in the layout - ThemeToggle component - Sonner Toaster's useTheme() so toasts respect the chosen theme - Appearance card on the Settings page Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
21 lines
485 B
TypeScript
21 lines
485 B
TypeScript
"use client";
|
|
|
|
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
|
import type { ComponentProps } from "react";
|
|
|
|
type ThemeProviderProps = ComponentProps<typeof NextThemesProvider>;
|
|
|
|
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
|
|
return (
|
|
<NextThemesProvider
|
|
attribute="class"
|
|
defaultTheme="system"
|
|
enableSystem
|
|
disableTransitionOnChange
|
|
{...props}
|
|
>
|
|
{children}
|
|
</NextThemesProvider>
|
|
);
|
|
}
|