import { isUndefined } from "lodash-es"; import ShortcutList from "./ShortcutList"; import TagList from "./TagList"; import SearchBar from "./SearchBar"; import UsageHeatMap from "./UsageHeatMap"; import "../less/home-sidebar.less"; const HomeSidebar = () => { return ( <>
toggleHomeSidebar(false)}>
); }; export const toggleHomeSidebar = (show?: boolean) => { const sidebarEl = document.body.querySelector(".home-sidebar-wrapper") as HTMLDivElement; const maskEl = sidebarEl.previousSibling as HTMLDivElement; if (isUndefined(show)) { show = !sidebarEl.classList.contains("show"); } if (show) { sidebarEl.classList.add("show"); maskEl.classList.add("show"); } else { sidebarEl.classList.remove("show"); maskEl.classList.remove("show"); } }; export default HomeSidebar;