fix(dashboard): remove force color scheme since it breaks the build
This commit is contained in:
@@ -1,11 +1,13 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
|
import { NotificationProvider } from '@/components/notifications/notification-provider';
|
||||||
import { TooltipProvider } from '@/components/ui/tooltip';
|
import { TooltipProvider } from '@/components/ui/tooltip';
|
||||||
import { ModalProvider } from '@/modals';
|
import { ModalProvider } from '@/modals';
|
||||||
import type { AppStore } from '@/redux';
|
import type { AppStore } from '@/redux';
|
||||||
import makeStore from '@/redux';
|
import makeStore from '@/redux';
|
||||||
import { api } from '@/trpc/client';
|
import { api } from '@/trpc/client';
|
||||||
import { ClerkProvider, useAuth } from '@clerk/nextjs';
|
import { ClerkProvider, useAuth } from '@clerk/nextjs';
|
||||||
|
import { OpenPanelComponent } from '@openpanel/nextjs';
|
||||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||||
import { httpLink } from '@trpc/client';
|
import { httpLink } from '@trpc/client';
|
||||||
import { ThemeProvider } from 'next-themes';
|
import { ThemeProvider } from 'next-themes';
|
||||||
@@ -15,12 +17,7 @@ import { Provider as ReduxProvider } from 'react-redux';
|
|||||||
import { Toaster } from 'sonner';
|
import { Toaster } from 'sonner';
|
||||||
import superjson from 'superjson';
|
import superjson from 'superjson';
|
||||||
|
|
||||||
import { NotificationProvider } from '@/components/notifications/notification-provider';
|
|
||||||
import { OpenPanelComponent } from '@openpanel/nextjs';
|
|
||||||
import { useSearchParams } from 'next/navigation';
|
|
||||||
|
|
||||||
function AllProviders({ children }: { children: React.ReactNode }) {
|
function AllProviders({ children }: { children: React.ReactNode }) {
|
||||||
const searchParams = useSearchParams();
|
|
||||||
const { getToken } = useAuth();
|
const { getToken } = useAuth();
|
||||||
const [queryClient] = useState(
|
const [queryClient] = useState(
|
||||||
() =>
|
() =>
|
||||||
@@ -60,16 +57,12 @@ function AllProviders({ children }: { children: React.ReactNode }) {
|
|||||||
storeRef.current = makeStore();
|
storeRef.current = makeStore();
|
||||||
}
|
}
|
||||||
|
|
||||||
const forcedTheme = searchParams.get('colorScheme');
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider
|
<ThemeProvider
|
||||||
attribute="class"
|
attribute="class"
|
||||||
disableTransitionOnChange
|
disableTransitionOnChange
|
||||||
defaultTheme="system"
|
defaultTheme="system"
|
||||||
forcedTheme={
|
forcedTheme={'system'}
|
||||||
forcedTheme ? (forcedTheme === 'dark' ? 'dark' : 'light') : 'system'
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
{process.env.NEXT_PUBLIC_OP_CLIENT_ID && (
|
{process.env.NEXT_PUBLIC_OP_CLIENT_ID && (
|
||||||
<OpenPanelComponent
|
<OpenPanelComponent
|
||||||
|
|||||||
Reference in New Issue
Block a user