2023-02-08 17:58:55 -06:00
|
|
|
import Navbar from "@/components/Navbar";
|
|
|
|
import Sidebar from "@/components/Sidebar";
|
2023-07-16 10:51:24 -05:00
|
|
|
import { ReactNode, useEffect } from "react";
|
2023-06-12 23:46:32 -05:00
|
|
|
import ModalManagement from "@/components/ModalManagement";
|
2023-07-16 10:51:24 -05:00
|
|
|
import useModalStore from "@/store/modals";
|
2023-02-08 17:58:55 -06:00
|
|
|
|
2023-02-13 15:22:47 -06:00
|
|
|
interface Props {
|
2023-02-08 17:58:55 -06:00
|
|
|
children: ReactNode;
|
|
|
|
}
|
|
|
|
|
2023-06-09 17:31:14 -05:00
|
|
|
export default function MainLayout({ children }: Props) {
|
2023-07-16 10:51:24 -05:00
|
|
|
const { modal } = useModalStore();
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
modal
|
|
|
|
? (document.body.style.overflow = "hidden")
|
|
|
|
: (document.body.style.overflow = "auto");
|
|
|
|
}, [modal]);
|
|
|
|
|
2023-10-16 12:10:52 -05:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<ModalManagement />
|
2023-06-12 23:46:32 -05:00
|
|
|
|
2023-10-16 12:10:52 -05:00
|
|
|
<div className="flex">
|
|
|
|
<div className="hidden lg:block">
|
|
|
|
<Sidebar className="fixed top-0" />
|
|
|
|
</div>
|
2023-04-30 15:54:40 -05:00
|
|
|
|
2023-10-23 09:45:48 -05:00
|
|
|
<div className="w-full flex flex-col min-h-screen lg:ml-64 xl:ml-80">
|
2023-10-16 12:10:52 -05:00
|
|
|
<Navbar />
|
|
|
|
{children}
|
2023-02-08 17:58:55 -06:00
|
|
|
</div>
|
2023-10-16 12:10:52 -05:00
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
);
|
2023-02-08 17:58:55 -06:00
|
|
|
}
|