Skip to content

Commit a0bd9f1

Browse files
authored
Fix sidebar animation (#42)
1 parent e53aa4b commit a0bd9f1

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

web/src/components/Sidebar.tsx

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,21 @@ export const Sidebar: FC = () => {
5050
const { isAuthenticated } = useAuth();
5151
const { isSidebarOpen } = useApp();
5252

53-
if (!isSidebarOpen) {
54-
// Keep the sidebar width for layout, but hide content
55-
return (
56-
<div
57-
className="left-bar w-[240px] min-w-[180px] max-w-xs bg-secondary border-r border-r-secondary h-screen max-h-screen min-h-screen sticky top-0 transition-all duration-300"
58-
style={{
53+
return (
54+
<div
55+
className="left-bar space-y-2 bg-secondary border-r border-r-secondary h-screen max-h-screen min-h-screen sticky top-0 transition-all duration-300"
56+
style={{
57+
...(!isSidebarOpen && {
5958
width: 0,
6059
minWidth: 0,
6160
maxWidth: 0,
6261
overflow: 'hidden',
6362
padding: 0,
6463
border: 'none',
65-
}}
66-
/>
67-
);
68-
}
69-
70-
return (
71-
<div className="left-bar space-y-2 bg-secondary border-r border-r-secondary h-screen max-h-screen min-h-screen sticky top-0">
72-
<div className="flex flex-col justify-between h-screen">
64+
}),
65+
}}
66+
>
67+
<div className="flex flex-col justify-between h-screen min-w-[240px]">
7368
<nav className="w-full space-y-6 p-2 h-8">
7469
<div>
7570
<div className="flex items-stretch gap-2 h-full px-2">

0 commit comments

Comments
 (0)