This commit is contained in:
phaichayon
2026-04-16 16:59:46 +07:00
parent 4702150af1
commit ba1ffed211
165 changed files with 18353 additions and 219 deletions

View File

@@ -0,0 +1,31 @@
'use client';
import { ClerkProvider } from '@clerk/nextjs';
import { dark } from '@clerk/themes';
import { useTheme } from 'next-themes';
import React from 'react';
import { ActiveThemeProvider } from '../active-theme';
export default function Providers({
activeThemeValue,
children
}: {
activeThemeValue: string;
children: React.ReactNode;
}) {
// we need the resolvedTheme value to set the baseTheme for clerk based on the dark or light theme
const { resolvedTheme } = useTheme();
return (
<>
<ActiveThemeProvider initialTheme={activeThemeValue}>
<ClerkProvider
appearance={{
baseTheme: resolvedTheme === 'dark' ? dark : undefined
}}
>
{children}
</ClerkProvider>
</ActiveThemeProvider>
</>
);
}