diff --git a/src/Components/Sidebar/index.jsx b/src/Components/Sidebar/index.jsx index 0d760661f..8d65acdde 100644 --- a/src/Components/Sidebar/index.jsx +++ b/src/Components/Sidebar/index.jsx @@ -129,13 +129,14 @@ function Sidebar() { ); const sidebarRef = useRef(null); const [sidebarReady, setSidebarReady] = useState(false); + const TRANSITION_DURATION = 200; useEffect(() => { if (!collapsed) { setSidebarReady(false); const timeout = setTimeout(() => { setSidebarReady(true); - }, 200); + }, TRANSITION_DURATION); return () => clearTimeout(timeout); } else { setSidebarReady(false); @@ -205,13 +206,14 @@ function Sidebar() { }, [location]); const iconColor = theme.palette.primary.contrastTextTertiary; + const sidebarClassName = `${collapsed ? "collapsed" : "expanded"} ${sidebarReady ? "sidebar-ready" : ""}`; /* TODO refactor this, there are a some ternaries and comments in the return */ return (