File tree Expand file tree Collapse file tree 4 files changed +48
-34
lines changed
Expand file tree Collapse file tree 4 files changed +48
-34
lines changed Original file line number Diff line number Diff line change 11import type { Metadata } from "next" ;
22import { Inter } from "next/font/google" ;
3- import { GlobalProviders } from "@/components/global-providers" ;
3+ import { ClientProviders } from "@/components/client-providers" ;
4+ import { ServerProviders } from "@/components/server-providers" ;
45import "./globals.css" ;
56
67const inter = Inter ( {
@@ -21,7 +22,9 @@ export default async function RootLayout({
2122 return (
2223 < html lang = "en" suppressHydrationWarning >
2324 < body className = { `${ inter . variable } antialiased` } >
24- < GlobalProviders > { children } </ GlobalProviders >
25+ < ServerProviders >
26+ < ClientProviders > { children } </ ClientProviders >
27+ </ ServerProviders >
2528 </ body >
2629 </ html >
2730 ) ;
Original file line number Diff line number Diff line change 1+ "use client" ;
2+
3+ import { ThemeProvider } from "next-themes" ;
4+ import type { ReactNode } from "react" ;
5+
6+ interface ClientProvidersProps {
7+ children : ReactNode ;
8+ }
9+
10+ export function ClientProviders ( { children } : ClientProvidersProps ) {
11+ return (
12+ < ThemeProvider
13+ attribute = "class"
14+ defaultTheme = "system"
15+ enableSystem
16+ disableTransitionOnChange
17+ >
18+ { children }
19+ </ ThemeProvider >
20+ ) ;
21+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import { NuqsAdapter } from "nuqs/adapters/next/app" ;
2+ import type { ReactNode } from "react" ;
3+ import { Toaster } from "sonner" ;
4+
5+ interface ServerProvidersProps {
6+ children : ReactNode ;
7+ }
8+
9+ export function ServerProviders ( { children } : ServerProvidersProps ) {
10+ return (
11+ < NuqsAdapter >
12+ { children }
13+ < Toaster
14+ richColors
15+ duration = { 2000 }
16+ position = "bottom-right"
17+ offset = { { top : 50 } }
18+ closeButton
19+ />
20+ </ NuqsAdapter >
21+ ) ;
22+ }
You can’t perform that action at this time.
0 commit comments