diff --git a/frontends/dashboard/src/components/Sidebar.tsx b/frontends/dashboard/src/components/Sidebar.tsx index 99dc292892..af7da73bbd 100644 --- a/frontends/dashboard/src/components/Sidebar.tsx +++ b/frontends/dashboard/src/components/Sidebar.tsx @@ -1,8 +1,16 @@ -import { For, createMemo, createSignal, useContext } from "solid-js"; +import { + For, + createMemo, + createSignal, + useContext, + Show, + createEffect, +} from "solid-js"; import { UserContext } from "../contexts/UserContext"; import { useNavigate } from "@solidjs/router"; import { IoLogOutOutline, IoOpenOutline } from "solid-icons/io"; import { AiOutlinePlus, AiOutlineUser } from "solid-icons/ai"; +import { FaSolidAngleDown, FaSolidAngleRight } from "solid-icons/fa"; import CreateNewOrgModal from "./CreateNewOrgModal"; import { DatasetContext } from "../contexts/DatasetContext"; @@ -18,6 +26,16 @@ export const Sidebar = () => { const datasetContext = useContext(DatasetContext); const [showNewOrgModal, setShowNewOrgModal] = createSignal(false); + const [showSubMenu, setShowSubMenu] = createSignal( + localStorage.getItem("showSubMenu") !== "false", + ); + + createEffect(() => { + return localStorage.setItem( + "showSubMenu", + showSubMenu() ? "true" : "false", + ); + }); const sortedOrgs = createMemo( () => @@ -74,31 +92,71 @@ export const Sidebar = () => {