feat: add theming

This commit is contained in:
Stevan Freeborn
2023-09-09 21:39:08 -05:00
parent 272355d9a0
commit 4b6fec0841
11 changed files with 141 additions and 30 deletions
+14 -1
View File
@@ -3,6 +3,7 @@
import { useAuth } from '@clerk/nextjs';
import { ConvexReactClient } from 'convex/react';
import { ConvexProviderWithClerk } from 'convex/react-clerk';
import { ThemeProvider } from 'next-themes';
import { ReactNode } from 'react';
const CONVEX_URL = process.env.NEXT_PUBLIC_CONVEX_URL;
@@ -13,7 +14,7 @@ if (CONVEX_URL === undefined) {
const client = new ConvexReactClient(CONVEX_URL);
export default function ConvexProvider({ children }: { children: ReactNode }) {
export function ConvexProvider({ children }: { children: ReactNode }) {
return (
<ConvexProviderWithClerk
client={client}
@@ -23,3 +24,15 @@ export default function ConvexProvider({ children }: { children: ReactNode }) {
</ConvexProviderWithClerk>
);
}
export function NextThemesProvider({ children }: { children: ReactNode }) {
return (
<ThemeProvider
attribute='class'
defaultTheme='light'
enableSystem
>
{children}
</ThemeProvider>
);
}