Skip to content

Commit

Permalink
maybe this???
Browse files Browse the repository at this point in the history
  • Loading branch information
bartosz-skejcik committed Dec 22, 2023
1 parent 8a34bc9 commit 314506b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
12 changes: 8 additions & 4 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import type { Metadata } from "next";
import "@/app/tailwind.css";
import AuthProvider from "@/context/AuthProvider";

import { EdgeStoreProvider } from "@/lib/edgestore";

import { ToastContainer } from "react-toastify";

import "react-toastify/dist/ReactToastify.css";
Expand All @@ -29,10 +31,12 @@ export default function RootLayout({
return (
<html lang="pl">
<AuthProvider>
<body>
{children}
<ToastContainer />
</body>
<EdgeStoreProvider>
<body>
{children}
<ToastContainer />
</body>
</EdgeStoreProvider>
</AuthProvider>
</html>
);
Expand Down
60 changes: 28 additions & 32 deletions app/panel/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"use client";

import { EdgeStoreProvider } from "@/lib/edgestore";

import { Mobile, Sidebar } from "@/components/Sidebar";
import { useEffect, useState } from "react";
import {
Expand Down Expand Up @@ -85,36 +83,34 @@ export default function PanelLayout({ children }: Props) {
}, [pathname, userRole]);

return (
<EdgeStoreProvider>
<div>
<Mobile
user={session?.user}
sidebarOpen={sidebarOpen}
setSidebarOpen={setSidebarOpen}
navigation={
session?.user.role.toLocaleLowerCase() === "student"
? navigation[0]
: navigation[1]
}
/>
<div>
<Mobile
user={session?.user}
sidebarOpen={sidebarOpen}
setSidebarOpen={setSidebarOpen}
navigation={
session?.user.role.toLocaleLowerCase() === "student"
? navigation[0]
: navigation[1]
}
/>

{/* Static sidebar for desktop */}
<Sidebar
setNotifications={setNotifications}
notifications={notifications}
setSidebarOpen={setSidebarOpen}
user={session?.user}
navigation={
session?.user.role.toLocaleLowerCase() === "student"
? navigation[0]
: navigation[1]
}
>
<div className="px-4 py-4 sm:px-6 lg:px-8 grid grid-cols-3 grid-rows-2 gap-12 items-start h-full">
{children}
</div>
</Sidebar>
</div>
</EdgeStoreProvider>
{/* Static sidebar for desktop */}
<Sidebar
setNotifications={setNotifications}
notifications={notifications}
setSidebarOpen={setSidebarOpen}
user={session?.user}
navigation={
session?.user.role.toLocaleLowerCase() === "student"
? navigation[0]
: navigation[1]
}
>
<div className="px-4 py-4 sm:px-6 lg:px-8 grid grid-cols-3 grid-rows-2 gap-12 items-start h-full">
{children}
</div>
</Sidebar>
</div>
);
}

0 comments on commit 314506b

Please sign in to comment.