Skip to content

Commit

Permalink
🐛 fix: animation
Browse files Browse the repository at this point in the history
  • Loading branch information
nxhawk committed Oct 28, 2024
1 parent 2d4f504 commit ad73471
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/layout/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,16 @@ const SideBar = ({ isOpen }: Props) => {
}),
];

function returnWidth() {
if (isMobile) return "40px";
if (isOpen || isHovered) return "260px";
return "60px";
}

return (
<VStack
position="sticky"
minW={(isOpen || isHovered) && !isMobile ? "260px" : "60px"}
maxW={(isOpen || isHovered) && !isMobile ? "260px" : "60px"}
w={returnWidth()}
height="100dvh"
borderRight="1px"
align="flex-start"
Expand All @@ -121,6 +126,7 @@ const SideBar = ({ isOpen }: Props) => {
justifyContent="flex-start"
gap="10px"
paddingY="6"
paddingX={isMobile ? "2" : "4"}
_hover={{ bg: idx === selectedIndex ? "rgb(221, 242, 253)" : "rgba(0, 0, 0, 0.04)" }}
bg={idx === selectedIndex ? "rgb(221, 242, 253)" : "transparent"}
onClick={menu.onClick}
Expand Down

0 comments on commit ad73471

Please sign in to comment.