diff --git a/.env b/.env deleted file mode 100644 index afa66d4..0000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -VITE_SERVER_URL=http://localhost:3000/api \ No newline at end of file diff --git a/src/components/Layouts/LeftSidebar.jsx b/src/components/Layouts/LeftSidebar.jsx index 907eb61..ff1854d 100644 --- a/src/components/Layouts/LeftSidebar.jsx +++ b/src/components/Layouts/LeftSidebar.jsx @@ -10,6 +10,8 @@ import { } from "lucide-react"; import { useContext } from "react"; import CanvasContext from "../Context/canvasContext/CanvasContext"; +import { useParams } from "react-router-dom"; +import { useToast } from "@/hooks/use-toast"; const sidebarItems = [ { id: "design", icon: Text, label: "Design" }, @@ -23,6 +25,25 @@ const sidebarItems = [ export function Sidebar() { const { selectedPanel, setSelectedPanel } = useContext(CanvasContext); + + const params = useParams(); + const { id } = params; + + const { toast } = useToast(); + + const handleSelectedPanel = (panelId) => { + if (panelId === "project" && id) { + toast({ + title: "Unsaved Project", + description: "Please save the project first, or delete it. If you don't want to save it.", + variant: "destructive", + }) + } + else { + setSelectedPanel(panelId); + } + } + return (