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)}>
+
+
-
+