From f5582e96b2788c9fa66180f3dec7cbb8cb4e5a6a Mon Sep 17 00:00:00 2001 From: Zeeshan Mehboob <82993262+zesu22@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:44:36 +0530 Subject: [PATCH] [MODIFIED] initial rendering, slider in sidenavbar in mobile view (#296) Signed-off-by: Zeeshan Mehboob Signed-off-by: kaifk468 --- mock-relying-party-ui/src/components/Sidenav.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mock-relying-party-ui/src/components/Sidenav.js b/mock-relying-party-ui/src/components/Sidenav.js index ef807f70..791e1c6a 100644 --- a/mock-relying-party-ui/src/components/Sidenav.js +++ b/mock-relying-party-ui/src/components/Sidenav.js @@ -81,15 +81,14 @@ export default function Sidenav({ getMessages(); getUserDetails(authCode); }; + getSearchParams(); // hiding or showing the side nav // according to windows height - const handleResize = () => { - const { innerWidth: width } = window; - setShowMenu(width > 767); - }; + const handleResize = () => setShowMenu(window.innerWidth > 767); + // initial call to handleResize + handleResize(); // adding event listener for window resize window.addEventListener("resize", handleResize); - getSearchParams(); // removing event listener for window resize return () => window.removeEventListener("resize", handleResize); }, []); @@ -335,7 +334,7 @@ export default function Sidenav({ + (showMenu ? "" : "hidden")} aria-label="Sidebar" > -
+
@@ -349,9 +348,11 @@ export default function Sidenav({
Health Portal
-
setShowMenu(current => !current)}>
+
setShowMenu(current => !current)}>
+
+
-
+