feat: setup theme context config

This commit is contained in:
WanQuanXie 2024-05-24 18:20:15 +08:00
parent 79cfd0a722
commit f9664d48e7
4 changed files with 92 additions and 11 deletions

View file

@ -4,6 +4,7 @@ import './globals.css';
import { cn } from '@/lib/utils';
import Sidebar from '@/components/Sidebar';
import { Toaster } from 'sonner';
import { ThemeProviderComponent } from '@/components/theme/Provider';
const montserrat = Montserrat({
weight: ['300', '400', '500', '700'],
@ -24,18 +25,20 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html className="h-full" lang="en">
<html className="h-full" lang="en" suppressHydrationWarning>
<body className={cn('h-full', montserrat.className)}>
<Sidebar>{children}</Sidebar>
<Toaster
toastOptions={{
unstyled: true,
classNames: {
toast:
'bg-[#111111] text-white rounded-lg p-4 flex flex-row items-center space-x-2',
},
}}
/>
<ThemeProviderComponent>
<Sidebar>{children}</Sidebar>
<Toaster
toastOptions={{
unstyled: true,
classNames: {
toast:
'dark:dark:bg-[#111111] text-white rounded-lg p-4 flex flex-row items-center space-x-2',
},
}}
/>
</ThemeProviderComponent>
</body>
</html>
);