Merge pull request #1781 from bluewave-labs/fix/fe/sidebar-selection
fix: sidebar selection
This commit is contained in:
1 file changed
+12
-7
@@ -183,7 +183,7 @@ function Sidebar() {
|
|||||||
This is the top lever for styles
|
This is the top lever for styles
|
||||||
*/
|
*/
|
||||||
sx={{
|
sx={{
|
||||||
position: 'relative',
|
position: "relative",
|
||||||
border: 1,
|
border: 1,
|
||||||
borderColor: theme.palette.primary.lowContrast,
|
borderColor: theme.palette.primary.lowContrast,
|
||||||
borderRadius: theme.shape.borderRadius,
|
borderRadius: theme.shape.borderRadius,
|
||||||
@@ -306,12 +306,12 @@ function Sidebar() {
|
|||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
overflow: 'auto',
|
overflow: "auto",
|
||||||
overflowX: 'hidden',
|
overflowX: "hidden",
|
||||||
'&::-webkit-scrollbar': {
|
"&::-webkit-scrollbar": {
|
||||||
width: theme.spacing(2),
|
width: theme.spacing(2),
|
||||||
},
|
},
|
||||||
'&::-webkit-scrollbar-thumb': {
|
"&::-webkit-scrollbar-thumb": {
|
||||||
backgroundColor: theme.palette.primary.lowContrast,
|
backgroundColor: theme.palette.primary.lowContrast,
|
||||||
borderRadius: theme.spacing(4),
|
borderRadius: theme.spacing(4),
|
||||||
},
|
},
|
||||||
@@ -343,7 +343,10 @@ function Sidebar() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{menu.map((item) => {
|
{menu.map((item) => {
|
||||||
if (item.path === "distributed-uptime" && distributedUptimeEnabled === false) {
|
if (
|
||||||
|
item.path === "distributed-uptime" &&
|
||||||
|
distributedUptimeEnabled === false
|
||||||
|
) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return item.path ? (
|
return item.path ? (
|
||||||
@@ -367,7 +370,9 @@ function Sidebar() {
|
|||||||
disableInteractive
|
disableInteractive
|
||||||
>
|
>
|
||||||
<ListItemButton
|
<ListItemButton
|
||||||
className={location.pathname === `/${item.path}` ? "selected-path" : ""}
|
className={
|
||||||
|
location.pathname.startsWith(`/${item.path}`) ? "selected-path" : ""
|
||||||
|
}
|
||||||
onClick={() => navigate(`/${item.path}`)}
|
onClick={() => navigate(`/${item.path}`)}
|
||||||
sx={{
|
sx={{
|
||||||
height: "37px",
|
height: "37px",
|
||||||
|
|||||||
Reference in new issue
Block a user