/
DME
/
NotesApp
Обзор
Документация
Войти
/
DME
/
NotesApp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/app/layout.tsx
54 строки
1 KB
Karasique333
Commit
19 июн 2025, 15:09
19 июн 2025, 15:09
d96c829
Код
Авторство
О чём код?
import { type Metadata } from 'next' import { cookies } from 'next/headers' import { Toaster } from 'react-hot-toast' import { inter, notoSerif, sourceCodePro } from '@/lib/font' import { cn } from '@/lib/utils' import { ThemeProvider } from '@/components/provider' import { FontProvider } from '@/context/font-context' import { env } from '@/env' import '@/styles/globals.css' import { TRPCReactProvider } from '@/trpc/react' export const metadata: Metadata = { title: 'Заметки', description: '', icons: [{ rel: 'icon', url: '/favicon.ico' }], } export default async function RootLayout({ children, }: Readonly<{ children: React.ReactNode }>) { const cookieStore = await cookies() const theme = cookieStore.get('font-theme')?.value as | 'sans-serif' | 'serif' | 'monospace' return ( <html lang="en" className={`scroll-smooth`} suppressHydrationWarning> <body className={cn( 'antialiased', theme === 'serif' && `font-serif ${notoSerif.className}`, theme === 'monospace' && `font-mono ${sourceCodePro.className}`, theme === 'sans-serif' && `${inter.className}` )} > <FontProvider> <ThemeProvider attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange > <TRPCReactProvider>{children}</TRPCReactProvider> <Toaster /> </ThemeProvider> </FontProvider> </body> </html> ) }