issue #60
All checks were successful
Test CI / build (push) Successful in 17s

- 일정 등록 및 조회 컴포넌트 설계 및 구현 중
This commit is contained in:
2025-12-06 00:19:25 +09:00
parent 4a8e761b3d
commit 2c8dcf9db7
8 changed files with 95 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
import SideBar from "@/ui/component/SideBar";
import { Outlet } from "react-router-dom";
import { Outlet, useNavigate } from "react-router-dom";
import { SidebarProvider } from "@/components/ui/sidebar";
import Header from "@/ui/component/Header";
import { useAuthStore } from '@/store/authStore';
@@ -11,9 +11,22 @@ import {
OctagonXIcon,
TriangleAlertIcon,
} from "lucide-react";
import { useState } from "react";
export default function Layout() {
const { authData } = useAuthStore();
const [open, setOpen] = useState(false);
const navigate = useNavigate();
const pathname = location.pathname;
const goTo = (path: string) => {
console.log(path);
console.log(pathname);
if (path === pathname) return;
navigate(path);
setOpen(false);
}
return (
<>
<Toaster
@@ -27,10 +40,11 @@ export default function Layout() {
}}
/>
<SidebarProvider
defaultOpen={false}
open={open}
onOpenChange={setOpen}
id="root"
>
<SideBar />
<SideBar goTo={goTo} />
<div className="flex flex-col w-full h-full">
{ authData ? <Header /> : null}
<div className="w-full h-full p-2.5">