chore(layout): correct provider sequence

This commit is contained in:
Aslam H
2024-09-09 15:38:07 +07:00
parent 875c87a2a3
commit f683dcfe0d

View File

@@ -15,6 +15,20 @@ export const metadata: Metadata = {
description: "Organize world's knowledge, explore connections and curate learning paths" description: "Organize world's knowledge, explore connections and curate learning paths"
} }
const Providers = ({ children }: { children: React.ReactNode }) => (
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
<ClerkProviderClient>
<DeepLinkProvider>
<JotaiProvider>
<ConfirmProvider>
<JazzAndAuth>{children}</JazzAndAuth>
</ConfirmProvider>
</JotaiProvider>
</DeepLinkProvider>
</ClerkProviderClient>
</ThemeProvider>
)
export default function RootLayout({ export default function RootLayout({
children children
}: Readonly<{ }: Readonly<{
@@ -22,20 +36,12 @@ export default function RootLayout({
}>) { }>) {
return ( return (
<html lang="en" className="h-full w-full" suppressHydrationWarning> <html lang="en" className="h-full w-full" suppressHydrationWarning>
<ClerkProviderClient> <body className={cn("h-full w-full font-sans antialiased", GeistSans.variable, GeistMono.variable)}>
<DeepLinkProvider> <Providers>
<body className={cn("h-full w-full font-sans antialiased", GeistSans.variable, GeistMono.variable)}> {children}
<ThemeProvider attribute="class" defaultTheme="system" enableSystem> <Toaster expand={false} />
<JotaiProvider> </Providers>
<ConfirmProvider> </body>
<JazzAndAuth>{children}</JazzAndAuth>
<Toaster expand={false} />
</ConfirmProvider>
</JotaiProvider>
</ThemeProvider>
</body>
</DeepLinkProvider>
</ClerkProviderClient>
</html> </html>
) )
} }