Skip to content

Commit e214d9a

Browse files
committed
sidebar tweak
1 parent 6f6920f commit e214d9a

File tree

2 files changed

+73
-63
lines changed

2 files changed

+73
-63
lines changed

client/src/Components/v2/sidebar/Authfooter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const AuthFooter = ({ collapsed, accountMenuItems }: AuthFooterProps) =>
7676
alignItems="center"
7777
py={theme.spacing(4)}
7878
px={theme.spacing(8)}
79-
gap={theme.spacing(2)}
79+
gap={theme.spacing(4)}
8080
>
8181
<Avatar
8282
small
Lines changed: 72 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useEffect } from "react";
2+
import Backdrop from "@mui/material/Backdrop";
23
import Stack from "@mui/material/Stack";
34
import List from "@mui/material/List";
45
import Divider from "@mui/material/Divider";
@@ -51,71 +52,80 @@ export const Sidebar = () => {
5152
};
5253

5354
return (
54-
<Stack
55-
component="aside"
56-
position={isSmall ? "fixed" : "sticky"}
57-
top={0}
58-
left={0}
59-
minHeight={"100vh"}
60-
maxHeight={"100vh"}
61-
paddingTop={theme.spacing(6)}
62-
paddingBottom={theme.spacing(6)}
63-
gap={theme.spacing(6)}
64-
borderRight={`1px solid ${theme.palette.divider}`}
65-
width={width}
66-
sx={{
67-
transition: transition,
68-
zIndex: isSmall ? (t) => t.zIndex.drawer : "auto",
69-
}}
70-
>
71-
<List
72-
component="nav"
73-
disablePadding
55+
<>
56+
<Backdrop
57+
open={!collapsed && isSmall}
58+
onClick={() => dispatch(setCollapsed({ collapsed: true }))}
59+
sx={{ zIndex: 999 }}
60+
/>
61+
<Stack
62+
component="aside"
63+
position={isSmall ? "fixed" : "sticky"}
64+
top={0}
65+
left={0}
66+
minHeight={"100vh"}
67+
maxHeight={"100vh"}
68+
paddingTop={theme.spacing(6)}
69+
paddingBottom={theme.spacing(6)}
70+
gap={theme.spacing(6)}
71+
borderRight={`1px solid ${theme.palette.divider}`}
72+
width={width}
7473
sx={{
75-
px: theme.spacing(6),
76-
flex: 1,
74+
touchAction: "none",
75+
transition: transition,
76+
zIndex: 1000,
77+
backdropFilter: "blur(8px)",
7778
}}
7879
>
79-
<Logo
80-
pt={theme.spacing(8)}
81-
pb={theme.spacing(10)}
82-
/>
83-
{menu.map((item) => {
84-
const selected = location.pathname.startsWith(`/${item.path}`);
85-
return (
86-
<NavItem
87-
key={item.path}
88-
item={item}
89-
selected={selected}
90-
onClick={() => handleNavClick(item.path)}
91-
/>
92-
);
93-
})}
94-
</List>
95-
<StarPrompt />
96-
<List
97-
component="nav"
98-
disablePadding
99-
sx={{ px: theme.spacing(6) }}
100-
>
101-
{bottomMenu.map((item) => {
102-
const selected = location.pathname.startsWith(`/${item.path}`);
103-
return (
104-
<NavItem
105-
key={item.path}
106-
item={item}
107-
selected={selected}
108-
onClick={() => handleNavClick(item.path)}
109-
/>
110-
);
111-
})}
112-
</List>
113-
<Divider sx={{ borderColor: theme.palette.divider }} />
80+
<List
81+
component="nav"
82+
disablePadding
83+
sx={{
84+
px: theme.spacing(6),
85+
flex: 1,
86+
}}
87+
>
88+
<Logo
89+
pt={theme.spacing(8)}
90+
pb={theme.spacing(10)}
91+
/>
92+
{menu.map((item) => {
93+
const selected = location.pathname.startsWith(`/${item.path}`);
94+
return (
95+
<NavItem
96+
key={item.path}
97+
item={item}
98+
selected={selected}
99+
onClick={() => handleNavClick(item.path)}
100+
/>
101+
);
102+
})}
103+
</List>
104+
<StarPrompt />
105+
<List
106+
component="nav"
107+
disablePadding
108+
sx={{ px: theme.spacing(6) }}
109+
>
110+
{bottomMenu.map((item) => {
111+
const selected = location.pathname.startsWith(`/${item.path}`);
112+
return (
113+
<NavItem
114+
key={item.path}
115+
item={item}
116+
selected={selected}
117+
onClick={() => handleNavClick(item.path)}
118+
/>
119+
);
120+
})}
121+
</List>
122+
<Divider sx={{ borderColor: theme.palette.divider }} />
114123

115-
<AuthFooter
116-
collapsed={collapsed}
117-
accountMenuItems={accountMenu}
118-
/>
119-
</Stack>
124+
<AuthFooter
125+
collapsed={collapsed}
126+
accountMenuItems={accountMenu}
127+
/>
128+
</Stack>
129+
</>
120130
);
121131
};

0 commit comments

Comments
 (0)