Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ES-1918] modified initial rendering, slider in sidenavbar in mobile view #296

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions mock-relying-party-ui/src/components/Sidenav.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}, []);
Expand Down Expand Up @@ -335,7 +334,7 @@ export default function Sidenav({
+ (showMenu ? "" : "hidden")}
aria-label="Sidebar"
>
<div className="h-full md:px-3 md:py-4">
<div className="md:px-3 md:py-4">
<div className="hidden md:flex items-center justify-center col-start-1">
<img src="images/doctor_logo.png" className="w-16 h-16 mx-4" />
<span className="title-font text-1xl text-gray-900 font-medium">
Expand All @@ -349,9 +348,11 @@ export default function Sidenav({
<div className="w-[58px] font-normal text-base/[18px]">Health Portal</div>
</div>
<div className="flex justify-end items-center">
<div className="p-1.5 m-2 before:content-['\2715'] cursor-pointer" onClick={() => setShowMenu(current => !current)}></div>
<div className="p-1.5 m-1.5 before:content-['\2715'] cursor-pointer" onClick={() => setShowMenu(current => !current)}></div>
</div>
</div>
</div>
<div className="h-full md:px-3 pb-[110px] overflow-scroll">
<ul className="p-4 md:px-0 md:py-2">
<li>
<a
Expand Down Expand Up @@ -595,7 +596,7 @@ export default function Sidenav({
</div>
</ul>
</div>
<div className="md:hidden w-full absolute bottom-0 border-t-2 p-4">
<div className="md:hidden w-full absolute bottom-0 border-t-2 p-4 bg-white z-10">
<div className="flex justify-between items-center">
<div className="flex items-center">
<img
Expand Down
Loading