tasko/app/(platform)/layout.tsx

31 lines
811 B
TypeScript
Raw Permalink Normal View History

'use client';
2024-02-16 01:49:19 +00:00
import { Toaster } from 'sonner';
import { ClerkProvider } from '@clerk/nextjs';
import { dark } from '@clerk/themes';
import { useTheme } from 'next-themes';
2024-02-15 02:30:10 +00:00
2024-02-16 01:49:19 +00:00
import { ModalProvider } from '@/components/providers/modal-provider';
import { QueryProvider } from '@/components/providers/query-provider';
2024-02-15 02:30:10 +00:00
const PlatformLayout = ({ children }: { children: React.ReactNode }) => {
2025-01-16 01:48:47 +00:00
const { resolvedTheme } = useTheme();
2024-02-15 02:30:10 +00:00
return (
<ClerkProvider
afterSignOutUrl='/'
appearance={{
2025-01-16 01:48:47 +00:00
baseTheme: resolvedTheme === 'dark' ? dark : undefined,
}}
>
2024-02-15 02:30:10 +00:00
<QueryProvider>
2025-01-16 01:48:47 +00:00
<Toaster theme={resolvedTheme === 'dark' ? 'dark' : 'light'} />
2024-02-15 02:30:10 +00:00
<ModalProvider />
{children}
</QueryProvider>
</ClerkProvider>
);
};
export default PlatformLayout;