import { useEffect } from "react"; import { resolution } from "../utils/layout"; import { useLayoutStore } from "../store/module"; import ShortcutList from "./ShortcutList"; import TagList from "./TagList"; import SearchBar from "./SearchBar"; import UsageHeatMap from "./UsageHeatMap"; import { useLocation } from "react-router-dom"; const HomeSidebar = () => { const location = useLocation(); const layoutStore = useLayoutStore(); const showHomeSidebar = layoutStore.state.showHomeSidebar; useEffect(() => { const handleWindowResize = () => { if (window.innerWidth < resolution.md) { layoutStore.setHomeSidebarStatus(false); } else { layoutStore.setHomeSidebarStatus(true); } }; window.addEventListener("resize", handleWindowResize); handleWindowResize(); }, [location]); return (
layoutStore.setHomeSidebarStatus(false)} >
); }; export default HomeSidebar;