From a5a2674f1f2c0ec72ad733ad11d8f615a9b45c8b Mon Sep 17 00:00:00 2001 From: Daniel Cojocea Date: Thu, 22 Aug 2024 15:00:44 -0400 Subject: [PATCH 1/3] Adjusted padding measurements --- Client/src/Components/Sidebar/index.css | 19 +++++++++----- Client/src/Components/Sidebar/index.jsx | 35 +++++++++++-------------- Client/src/Pages/Monitors/index.jsx | 1 + 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/Client/src/Components/Sidebar/index.css b/Client/src/Components/Sidebar/index.css index 10cdfc77d..1535b6143 100644 --- a/Client/src/Components/Sidebar/index.css +++ b/Client/src/Components/Sidebar/index.css @@ -76,14 +76,21 @@ aside .MuiCollapse-wrapperInner .MuiList-root > .MuiListItemButton-root::after { content: ""; position: absolute; left: -8px; - top: 50%; - transform: translateY(-50%); + top: 45%; height: 3px; width: 3px; border-radius: 50%; background-color: #d6d9dd; } +aside + .MuiCollapse-wrapperInner + .MuiList-root + > .selected-path.MuiListItemButton-root::after { + background-color: var(--env-var-color-2); + transform: scale(1.2); +} + aside { transition: flex 300ms ease-out; } @@ -104,20 +111,20 @@ aside { padding: 5px 8px; border-radius: var(--env-var-radius-1); } -.sidebar-popup li.MuiButtonBase-root:hover{ +.sidebar-popup li.MuiButtonBase-root:hover { background-color: var(--env-var-color-13); } -.sidebar-popup li.MuiButtonBase-root:has(.MuiBox-root):hover{ +.sidebar-popup li.MuiButtonBase-root:has(.MuiBox-root):hover { background-color: white; } -.sidebar-popup li.MuiButtonBase-root:has(.MuiBox-root){ +.sidebar-popup li.MuiButtonBase-root:has(.MuiBox-root) { padding-bottom: 0; } .sidebar-popup .MuiModal-root p.MuiTypography-root { font-size: var(--env-var-font-size-medium); color: var(--env-var-color-2); } -.sidebar-popup svg{ +.sidebar-popup svg { width: 16px; height: 16px; opacity: 0.9; diff --git a/Client/src/Components/Sidebar/index.jsx b/Client/src/Components/Sidebar/index.jsx index 69b44c125..ddcbf8ade 100644 --- a/Client/src/Components/Sidebar/index.jsx +++ b/Client/src/Components/Sidebar/index.jsx @@ -128,11 +128,7 @@ function Sidebar() { gap={theme.gap.medium} sx={{ flex: collapsed ? 0 : 1 }} > - + {collapsed ? ( ) : ( @@ -175,14 +171,14 @@ function Sidebar() { id="nested-menu-subheader" sx={{ pt: theme.gap.small, - px: collapsed ? theme.gap.xs : theme.gap.ml, + px: collapsed ? 0 : theme.gap.small, textAlign: collapsed ? "center" : "left", }} > Menu } - sx={{ px: collapsed ? theme.gap.xs : theme.gap.ml }} + sx={{ px: theme.gap.medium }} > {menu.map((item) => item.path ? ( @@ -210,9 +206,9 @@ function Sidebar() { } onClick={() => navigate(`/${item.path}`)} sx={{ - gap: theme.gap.medium, + gap: theme.gap.small, borderRadius: `${theme.shape.borderRadius}px`, - justifyContent: collapsed ? "center" : "flex-start", + px: theme.gap.small, }} > {item.icon} @@ -247,9 +243,9 @@ function Sidebar() { onClick={(event) => openPopup(event, item.name)} sx={{ position: "relative", - gap: theme.gap.medium, + gap: theme.gap.small, borderRadius: `${theme.shape.borderRadius}px`, - justifyContent: collapsed ? "center" : "flex-start", + px: theme.gap.small, }} > {item.icon} @@ -311,9 +307,9 @@ function Sidebar() { })) } sx={{ - gap: theme.gap.medium, + gap: theme.gap.small, borderRadius: `${theme.shape.borderRadius}px`, - justifyContent: collapsed ? "center" : "flex-start", + px: theme.gap.small, }} > {item.icon} @@ -324,7 +320,7 @@ function Sidebar() { {item.nested.map((child) => { if ( @@ -374,14 +370,14 @@ function Sidebar() { id="nested-other-subheader" sx={{ pt: theme.gap.small, - px: collapsed ? theme.gap.xs : theme.gap.ml, + px: collapsed ? 0 : theme.gap.small, textAlign: collapsed ? "center" : "left", }} > Other } - sx={{ px: collapsed ? theme.gap.xs : theme.gap.ml }} + sx={{ px: theme.gap.medium }} > {other.map((item) => ( {item.icon} @@ -432,10 +428,9 @@ function Sidebar() { diff --git a/Client/src/Pages/Monitors/index.jsx b/Client/src/Pages/Monitors/index.jsx index dc293ef49..15c98ce24 100644 --- a/Client/src/Pages/Monitors/index.jsx +++ b/Client/src/Pages/Monitors/index.jsx @@ -437,6 +437,7 @@ const Monitors = () => { Date: Thu, 22 Aug 2024 15:51:22 -0400 Subject: [PATCH 2/3] Added bwu icon --- Client/src/Components/Sidebar/index.jsx | 43 ++++++++++++++++----- Client/src/assets/icons/bwu-abbreviated.svg | 4 -- 2 files changed, 34 insertions(+), 13 deletions(-) delete mode 100644 Client/src/assets/icons/bwu-abbreviated.svg diff --git a/Client/src/Components/Sidebar/index.jsx b/Client/src/Components/Sidebar/index.jsx index ddcbf8ade..bdf1fcf65 100644 --- a/Client/src/Components/Sidebar/index.jsx +++ b/Client/src/Components/Sidebar/index.jsx @@ -26,8 +26,6 @@ import LockSvg from "../../assets/icons/lock.svg?react"; import UserSvg from "../../assets/icons/user.svg?react"; import TeamSvg from "../../assets/icons/user-two.svg?react"; import LogoutSvg from "../../assets/icons/logout.svg?react"; -import BWULogo from "../../assets/Images/bwl-logo.svg?react"; -import BWULogoAbbreviated from "../../assets/icons/bwu-abbreviated.svg?react"; import Support from "../../assets/icons/support.svg?react"; import Dashboard from "../../assets/icons/dashboard.svg?react"; import Account from "../../assets/icons/user-edit.svg?react"; @@ -128,17 +126,44 @@ function Sidebar() { gap={theme.gap.medium} sx={{ flex: collapsed ? 0 : 1 }} > - - {collapsed ? ( - - ) : ( - - )} + + + + BU + + {!collapsed && ( + + BlueWave Uptime + + )} + - - - From c112fb45b62862e1fac22b28ba99fa58ed9dfcd5 Mon Sep 17 00:00:00 2001 From: Daniel Cojocea Date: Thu, 22 Aug 2024 17:13:29 -0400 Subject: [PATCH 3/3] Fixed wonky animation --- Client/src/Components/Sidebar/index.css | 50 ++++++++++++++++++++++--- Client/src/Components/Sidebar/index.jsx | 43 ++++++++++----------- 2 files changed, 65 insertions(+), 28 deletions(-) diff --git a/Client/src/Components/Sidebar/index.css b/Client/src/Components/Sidebar/index.css index 1535b6143..8ce0089bc 100644 --- a/Client/src/Components/Sidebar/index.css +++ b/Client/src/Components/Sidebar/index.css @@ -91,10 +91,6 @@ aside transform: scale(1.2); } -aside { - transition: flex 300ms ease-out; -} - .sidebar-popup .MuiPaper-root { box-shadow: var(--env-var-shadow-1); border: solid 1px var(--env-var-color-6); @@ -102,7 +98,7 @@ aside { gap: 1px; } .sidebar-popup .MuiList-root { - padding: 6px 6px; + padding: 3px; min-width: 100px; } .sidebar-popup li.MuiButtonBase-root { @@ -129,3 +125,47 @@ aside { height: 16px; opacity: 0.9; } + +/* TRANSITIONS */ +aside { + flex: 1; + transition: max-width 650ms cubic-bezier(0.36, -0.01, 0, 0.77); +} +.home-layout aside.collapsed { + max-width: 64px; +} + +aside.expanded .MuiTypography-root, +aside.expanded p.MuiTypography-root, +aside.expanded .MuiListItemText-root + svg, +aside.expanded .MuiAvatar-root + .MuiBox-root + .MuiIconButton-root { + visibility: visible; + animation: fadeIn 1s ease; +} + +aside.collapsed .MuiTypography-root, +aside.collapsed p.MuiTypography-root, +aside.collapsed .MuiListItemText-root + svg, +aside.collapsed .MuiAvatar-root + .MuiBox-root + .MuiIconButton-root { + opacity: 0; + visibility: hidden; +} + +aside .MuiListSubheader-root { + transition: all 200ms ease; +} + +@keyframes fadeIn { + 0% { + opacity: 0; + visibility: hidden; + } + 30% { + opacity: 0; + visibility: hidden; + } + 100% { + opacity: 0.9; + visibility: visible; + } +} diff --git a/Client/src/Components/Sidebar/index.jsx b/Client/src/Components/Sidebar/index.jsx index bdf1fcf65..f1bfcb719 100644 --- a/Client/src/Components/Sidebar/index.jsx +++ b/Client/src/Components/Sidebar/index.jsx @@ -123,14 +123,10 @@ function Sidebar() { return ( - + BU - {!collapsed && ( - - BlueWave Uptime - - )} + + BlueWave Uptime + dispatch(toggleSidebar())} + onClick={() => { + setOpen({ Dashboard: false, Account: false }); + dispatch(toggleSidebar()); + }} > {collapsed ? : } @@ -196,8 +193,7 @@ function Sidebar() { id="nested-menu-subheader" sx={{ pt: theme.gap.small, - px: collapsed ? 0 : theme.gap.small, - textAlign: collapsed ? "center" : "left", + px: collapsed ? theme.gap.xs : theme.gap.small, }} > Menu @@ -231,13 +227,14 @@ function Sidebar() { } onClick={() => navigate(`/${item.path}`)} sx={{ + height: "37px", gap: theme.gap.small, borderRadius: `${theme.shape.borderRadius}px`, px: theme.gap.small, }} > {item.icon} - {!collapsed && {item.name}} + {item.name} ) : collapsed ? ( @@ -274,7 +271,7 @@ function Sidebar() { }} > {item.icon} - {!collapsed && {item.name}} + {item.name} {item.nested.map((child) => { if ( @@ -313,6 +310,7 @@ function Sidebar() { gap: theme.gap.small, borderRadius: `${theme.shape.borderRadius}px`, pl: theme.gap.small, + mb:"1px" }} > {child.icon} @@ -396,7 +394,6 @@ function Sidebar() { sx={{ pt: theme.gap.small, px: collapsed ? 0 : theme.gap.small, - textAlign: collapsed ? "center" : "left", }} > Other @@ -443,7 +440,7 @@ function Sidebar() { }} > {item.icon} - {!collapsed && {item.name}} + {item.name} ))}