Skip to content

Commit

Permalink
Move edge store provider to admin layout
Browse files Browse the repository at this point in the history
  • Loading branch information
salimi-my committed Feb 5, 2024
1 parent eb58bc2 commit d01c7b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
5 changes: 3 additions & 2 deletions app/admin/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import useStore from '@/hooks/use-store';
import Footer from '@/components/admin/footer';
import Navbar from '@/components/admin/navbar';
import Sidebar from '@/components/admin/sidebar';
import { EdgeStoreProvider } from '@/lib/edgestore';
import ModalProvider from '@/providers/modal-provider';
import useSidebarToggle from '@/hooks/use-sidebar-toggle';

Expand All @@ -16,7 +17,7 @@ export default function AdminLayout({
const sidebar = useStore(useSidebarToggle, (state) => state);

return (
<>
<EdgeStoreProvider>
<Sidebar />
<main
className={cn(
Expand All @@ -36,6 +37,6 @@ export default function AdminLayout({
<Footer />
</footer>
<ModalProvider />
</>
</EdgeStoreProvider>
);
}
11 changes: 4 additions & 7 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Inter } from 'next/font/google';
import { SessionProvider } from 'next-auth/react';

import { auth } from '@/auth';
import { EdgeStoreProvider } from '@/lib/edgestore';
import ToastProvider from '@/providers/toast-provider';
import { ThemeProvider } from '@/providers/theme-provider';

Expand Down Expand Up @@ -51,12 +50,10 @@ export default async function RootLayout({
<SessionProvider session={session}>
<html lang='en' suppressHydrationWarning>
<body className={inter.className}>
<EdgeStoreProvider>
<ThemeProvider attribute='class' defaultTheme='system' enableSystem>
{children}
<ToastProvider />
</ThemeProvider>
</EdgeStoreProvider>
<ThemeProvider attribute='class' defaultTheme='system' enableSystem>
{children}
<ToastProvider />
</ThemeProvider>
</body>
</html>
</SessionProvider>
Expand Down
1 change: 0 additions & 1 deletion routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export const publicRoutes = [
'/download-cv',
'/api/send',
'/api/portfolio',
'/api/edgestore/init',
'/api/resume/generate-link',
'/api/resume/download-file'
];
Expand Down

0 comments on commit d01c7b1

Please sign in to comment.