mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
refactor: filter store (#1331)
This commit is contained in:
@ -5,8 +5,10 @@ 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;
|
||||
|
||||
@ -20,7 +22,7 @@ const HomeSidebar = () => {
|
||||
};
|
||||
window.addEventListener("resize", handleWindowResize);
|
||||
handleWindowResize();
|
||||
}, []);
|
||||
}, [location]);
|
||||
|
||||
return (
|
||||
<div
|
||||
@ -35,7 +37,7 @@ const HomeSidebar = () => {
|
||||
onClick={() => layoutStore.setHomeSidebarStatus(false)}
|
||||
></div>
|
||||
<aside
|
||||
className={`absolute md:relative top-0 right-0 w-56 pr-2 md:w-full h-full max-h-screen overflow-auto hide-scrollbar flex flex-col justify-start items-start py-4 z-30 bg-white dark:bg-zinc-800 md:bg-transparent md:shadow-none transition-all duration-300 translate-x-full md:translate-x-0 ${
|
||||
className={`absolute md:relative top-0 right-0 w-56 pr-2 md:w-full h-full max-h-screen overflow-auto hide-scrollbar flex flex-col justify-start items-start py-4 z-30 bg-zinc-100 dark:bg-zinc-800 md:bg-transparent md:shadow-none transition-all duration-300 translate-x-full md:translate-x-0 ${
|
||||
showHomeSidebar && "!translate-x-0 shadow-2xl"
|
||||
}`}
|
||||
>
|
||||
|
Reference in New Issue
Block a user