- 로그인 버튼 비활성화 오류 해결 - 로그인 요칭 및 응답에 따른 토스트 구현
This commit is contained in:
@@ -3,21 +3,40 @@ import { Outlet } from "react-router-dom";
|
||||
import { SidebarProvider } from "@/components/ui/sidebar";
|
||||
import Header from "@/ui/component/Header";
|
||||
import { useAuthStore } from '@/store/authStore';
|
||||
import { Toaster, type ToasterProps } from "sonner";
|
||||
import {
|
||||
CircleCheckIcon,
|
||||
InfoIcon,
|
||||
Loader2Icon,
|
||||
OctagonXIcon,
|
||||
TriangleAlertIcon,
|
||||
} from "lucide-react";
|
||||
|
||||
export default function Layout() {
|
||||
const { authData } = useAuthStore();
|
||||
|
||||
return (
|
||||
<SidebarProvider
|
||||
defaultOpen={false}
|
||||
id="root"
|
||||
>
|
||||
<SideBar />
|
||||
<div className="flex flex-col w-full h-full">
|
||||
{ authData?.isLogedIn ? <Header /> : null}
|
||||
{/* <Header /> */}
|
||||
<Outlet />
|
||||
</div>
|
||||
</SidebarProvider>
|
||||
<>
|
||||
<Toaster
|
||||
position="top-center"
|
||||
icons={{
|
||||
success: <CircleCheckIcon className="size-4" fill="#15b815" color="white" />,
|
||||
error: <OctagonXIcon className="size-4" fill="#f14e4e" color="white" />,
|
||||
info: <InfoIcon className="size-4" fill="black" color="white" />,
|
||||
warning: <TriangleAlertIcon className="size-4" fill="#ffd500" color="white" />,
|
||||
loading: <Loader2Icon className="size-4 animate-spin" fill="white" color="black" />
|
||||
}}
|
||||
/>
|
||||
<SidebarProvider
|
||||
defaultOpen={false}
|
||||
id="root"
|
||||
>
|
||||
<SideBar />
|
||||
<div className="flex flex-col w-full h-full">
|
||||
{ authData?.isLogedIn ? <Header /> : null}
|
||||
{/* <Header /> */}
|
||||
<Outlet />
|
||||
</div>
|
||||
</SidebarProvider>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user