- ThemeProvider (next-themes, attribute=class, defaultTheme=system) - ModeToggle в header: светлая / тёмная / системная - suppressHydrationWarning на <html> против FOUC - логотип в SidebarHeader через SidebarMenuButton size="lg" (корректное схлопывание в icon-режиме, aspect-square для иконки) Co-authored-by: Cursor <cursoragent@cursor.com>
16 lines
370 B
TypeScript
16 lines
370 B
TypeScript
import { ThemeProvider as NextThemesProvider } from 'next-themes'
|
|
import type { ReactNode } from 'react'
|
|
|
|
export function ThemeProvider({ children }: { children: ReactNode }) {
|
|
return (
|
|
<NextThemesProvider
|
|
attribute="class"
|
|
defaultTheme="system"
|
|
enableSystem
|
|
disableTransitionOnChange
|
|
>
|
|
{children}
|
|
</NextThemesProvider>
|
|
)
|
|
}
|