feat: replace ThemeProvider with Providers component
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { QueryProvider } from '@utils/ui';
|
||||||
|
import type { ThemeProviderProps } from 'next-themes';
|
||||||
|
import { ThemeProvider as NextThemesProvider } from 'next-themes';
|
||||||
|
|
||||||
|
export function Providers({ children, ...props }: ThemeProviderProps) {
|
||||||
|
return (
|
||||||
|
<QueryProvider>
|
||||||
|
<NextThemesProvider {...props}>{children}</NextThemesProvider>
|
||||||
|
</QueryProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
'use client';
|
|
||||||
|
|
||||||
import type { ThemeProviderProps } from 'next-themes';
|
|
||||||
import { ThemeProvider as NextThemesProvider } from 'next-themes';
|
|
||||||
|
|
||||||
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
|
|
||||||
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import { poppins } from '@/lib/fonts';
|
import { poppins } from '@/lib/fonts';
|
||||||
import '@/styles/globals.css';
|
import '@/styles/globals.css';
|
||||||
import { type Metadata } from 'next';
|
import { type Metadata } from 'next';
|
||||||
import { ThemeProvider } from './_components/theme-provider';
|
import { Providers } from './_components/providers';
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: 'IMPHNEN - Ingin Menjadi Programmer Handal Namung Enggan Ngonding',
|
title: 'IMPHNEN - Ingin Menjadi Programmer Handal Namun Enggan Ngonding',
|
||||||
description:
|
description:
|
||||||
'Komunitas Ingin Menjadi Programmer Handal Namung Enggan Ngonding',
|
'Komunitas Ingin Menjadi Programmer Handal Namung Enggan Ngonding',
|
||||||
};
|
};
|
||||||
@@ -17,14 +17,14 @@ export default function RootLayout({
|
|||||||
return (
|
return (
|
||||||
<html lang="id" suppressHydrationWarning>
|
<html lang="id" suppressHydrationWarning>
|
||||||
<body className={poppins.className}>
|
<body className={poppins.className}>
|
||||||
<ThemeProvider
|
<Providers
|
||||||
attribute="class"
|
attribute="class"
|
||||||
defaultTheme="system"
|
defaultTheme="system"
|
||||||
enableSystem
|
enableSystem
|
||||||
disableTransitionOnChange
|
disableTransitionOnChange
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</ThemeProvider>
|
</Providers>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user