From c3cefc40e5d966c34183b11dae90fcb22ecf4516 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 15 Aug 2024 21:38:21 -0400 Subject: [PATCH] fix: Improve sidebar loading state --- app/components/Sidebar/Sidebar.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/components/Sidebar/Sidebar.tsx b/app/components/Sidebar/Sidebar.tsx index d92039b06e..ae4de426e5 100644 --- a/app/components/Sidebar/Sidebar.tsx +++ b/app/components/Sidebar/Sidebar.tsx @@ -274,14 +274,12 @@ const hoverStyles = (props: ContainerProps) => ` `; const Container = styled(Flex)` - opacity: ${(props) => (props.$hidden ? 0 : 1)}; position: fixed; top: 0; bottom: 0; width: 100%; background: ${s("sidebarBackground")}; - transition: box-shadow 150ms ease-in-out, opacity 150ms ease-in-out, - transform 150ms ease-out, + transition: box-shadow 150ms ease-in-out, transform 150ms ease-out, ${s("backgroundTransition")} ${(props: ContainerProps) => props.$isAnimating ? `,width ${ANIMATION_MS}ms ease-out` : ""}; @@ -299,7 +297,9 @@ const Container = styled(Flex)` } & > div { - opacity: ${(props) => (props.$collapsed && !props.$isHovering ? "0" : "1")}; + transition: opacity 150ms ease-in-out; + opacity: ${(props) => + props.$hidden || (props.$collapsed && !props.$isHovering) ? "0" : "1"}; } ${breakpoint("tablet")`