diff --git a/Client/src/Components/Sidebar/index.css b/Client/src/Components/Sidebar/index.css index 36415438c..d41778624 100644 --- a/Client/src/Components/Sidebar/index.css +++ b/Client/src/Components/Sidebar/index.css @@ -52,7 +52,7 @@ aside > .MuiListItemButton-root::before { content: ""; position: absolute; - left: -8px; + left: -7px; top: 0; height: 100%; width: 100%; @@ -65,7 +65,8 @@ aside > .MuiListItemButton-root:last-child::before { height: 50%; } -aside .MuiCollapse-wrapperInner .MuiList-root svg { +aside .MuiCollapse-wrapperInner .MuiList-root svg, +aside .MuiList-root .MuiListItemText-root + svg { width: 18px; height: 18px; } @@ -73,11 +74,18 @@ aside .MuiCollapse-wrapperInner .MuiList-root svg { aside .MuiCollapse-wrapperInner .MuiList-root > .MuiListItemButton-root::after { content: ""; position: absolute; - left: -8px; + left: -7px; top: 50%; height: 1px; - width: 7px; + width: 6px; border-radius: 50%; background-color: var(--env-var-color-5); opacity: 0.3; } + +aside { + transition: flex 300ms ease-out; +} +aside .MuiList-root { + transition: padding 100ms ease; +} \ No newline at end of file diff --git a/Client/src/Components/Sidebar/index.jsx b/Client/src/Components/Sidebar/index.jsx index 159b01503..74e868aa8 100644 --- a/Client/src/Components/Sidebar/index.jsx +++ b/Client/src/Components/Sidebar/index.jsx @@ -36,6 +36,8 @@ import PageSpeed from "../../assets/icons/page-speed.svg?react"; import Settings from "../../assets/icons/settings.svg?react"; import ArrowDown from "../../assets/icons/down-arrow.svg?react"; import ArrowUp from "../../assets/icons/up-arrow.svg?react"; +import ArrowRight from "../../assets/icons/right-arrow.svg?react"; +import ArrowLeft from "../../assets/icons/left-arrow.svg?react"; import "./index.css"; @@ -82,6 +84,7 @@ function Sidebar() { const dispatch = useDispatch(); const authState = useSelector((state) => state.auth); const [open, setOpen] = useState({ Dashboard: false, Account: false }); + const [collapsed, setCollapsed] = useState(false); /** * Handles logging out the user @@ -105,9 +108,42 @@ function Sidebar() { }, []); return ( - - - + + + {!collapsed && } + setCollapsed(!collapsed)} + > + {collapsed ? : } + {/* menu */} Menu } + sx={{ px: collapsed ? theme.gap.xs : theme.gap.ml }} > {menu.map((item) => item.path ? ( @@ -135,10 +176,23 @@ function Sidebar() { sx={{ gap: theme.gap.medium, borderRadius: `${theme.shape.borderRadius}px`, + justifyContent: collapsed ? "center" : "flex-start", }} > {item.icon} - {item.name} + {!collapsed && {item.name}} + + ) : collapsed ? ( + + {item.icon} + {!collapsed && {item.name}} ) : ( @@ -152,6 +206,7 @@ function Sidebar() { sx={{ gap: theme.gap.medium, borderRadius: `${theme.shape.borderRadius}px`, + justifyContent: collapsed ? "center" : "flex-start", }} > {item.icon} @@ -210,11 +265,16 @@ function Sidebar() { Other } + sx={{ px: collapsed ? theme.gap.xs : theme.gap.ml }} > {other.map((item) => ( {item.icon} - {item.name} + {!collapsed && {item.name}} ))} + - - - {authState.user?.firstName} {authState.user?.lastName} - - - {authState.user?.role} - - - - - - - + {!collapsed && ( + <> + + + {authState.user?.firstName} {authState.user?.lastName} + + + {authState.user?.role} + + + + + + + + + )} ); diff --git a/Client/src/Layouts/HomeLayout/index.css b/Client/src/Layouts/HomeLayout/index.css index f143b3fd9..dcdcf0535 100644 --- a/Client/src/Layouts/HomeLayout/index.css +++ b/Client/src/Layouts/HomeLayout/index.css @@ -19,7 +19,6 @@ height: calc(100vh - var(--env-var-spacing-2) * 2); max-width: var(--env-var-side-bar-width); - flex: 1; border: 1px solid var(--color-border-0); border-radius: var(--env-var-radius-1); @@ -27,10 +26,6 @@ padding: var(--env-var-spacing-1) 0; } -.home-layout aside > *:not(:first-child) { - padding-left: var(--env-var-spacing-1-plus); - padding-right: var(--env-var-spacing-1-plus); -} .home-layout > div { min-height: calc(100vh - var(--env-var-spacing-2) * 2); diff --git a/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.jsx b/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.jsx index 187d9c63d..8fff6e4a1 100644 --- a/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.jsx +++ b/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.jsx @@ -2,7 +2,7 @@ import { Box, Stack, Typography } from "@mui/material"; import "./index.css"; import React, { useState } from "react"; import Button from "../../../Components/Button"; -import Back from "../../../assets/icons/left-arrow.svg?react"; +import Back from "../../../assets/icons/left-arrow-long.svg?react"; import Select from "../../../Components/Inputs/Select"; import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs"; import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider"; diff --git a/Client/src/assets/icons/left-arrow-long.svg b/Client/src/assets/icons/left-arrow-long.svg new file mode 100644 index 000000000..db9b827ed --- /dev/null +++ b/Client/src/assets/icons/left-arrow-long.svg @@ -0,0 +1,3 @@ + + + diff --git a/Client/src/assets/icons/left-arrow.svg b/Client/src/assets/icons/left-arrow.svg index db9b827ed..8b38c408a 100644 --- a/Client/src/assets/icons/left-arrow.svg +++ b/Client/src/assets/icons/left-arrow.svg @@ -1,3 +1,3 @@ - - + +