-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes: #... ## Checklist - [x] I have made ProfileLayout responsive - [x] I have made ProfileLanding responsive ## Changelog - made ProfileLanding responsive - made ProfileLayout responsive - added resized StudentProgress for smaller screens - added MobileMenuContainer for displaying profile menu links for smaller screens ## How to test - Run monoweb - Navigate to <code>/profile</code> - Resize window
- Loading branch information
Showing
6 changed files
with
142 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...eb/src/components/organisms/Navbar/components/profile/ProfileMenu/MobileMenuContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { useEffect, useState } from "react" | ||
import { Icon } from "@dotkomonline/ui" | ||
import * as Popover from "@radix-ui/react-popover" | ||
import { usePathname } from "next/navigation" | ||
import { profileItems } from "@/utils/profileLinks" | ||
import ProfileMenuItem from "./ProfileMenuItem" | ||
|
||
const MobileMenuContainer = () => { | ||
const currentSlug = usePathname() | ||
const currentLink = profileItems.find((item) => item.slug === currentSlug) | ||
const [open, setOpen] = useState(false) | ||
|
||
useEffect(() => { | ||
if (open) { | ||
document.body.classList.add("overflow-hidden") | ||
} else { | ||
document.body.classList.remove("overflow-hidden") | ||
} | ||
}, [open]) | ||
|
||
return ( | ||
<div className="mx-auto flex items-center md:hidden"> | ||
<Popover.Root open={open} onOpenChange={(val: boolean) => setOpen(val)}> | ||
<Popover.Trigger> | ||
<div className="mt-3 flex"> | ||
<span className="float-left"> | ||
{open ? ( | ||
<Icon icon={"tabler:chevron-down"} width={28} /> | ||
) : ( | ||
<Icon icon={"tabler:chevron-right"} width={28} /> | ||
)} | ||
</span> | ||
<p className="flex grow justify-center"> | ||
<Icon icon={currentLink?.icon ? currentLink.icon : ""} width={28} /> | ||
<span className="ml-2 mt-1 text-lg">{currentLink?.title}</span> | ||
</p> | ||
</div> | ||
</Popover.Trigger> | ||
<Popover.Portal> | ||
<Popover.Content className="animate-in fade-in-10"> | ||
<div className="bg-indigo-1 shadow-slate-8 flex w-screen flex-col rounded-lg p-3 shadow-sm md:hidden"> | ||
{profileItems.map((item) => ( | ||
<Popover.Close key={item.title}> | ||
<ProfileMenuItem menuItem={item} /> | ||
</Popover.Close> | ||
))} | ||
</div> | ||
</Popover.Content> | ||
</Popover.Portal> | ||
</Popover.Root> | ||
</div> | ||
) | ||
} | ||
|
||
export default MobileMenuContainer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cb3ac6b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
web – ./apps/web
web-dotkom.vercel.app
web-git-main-dotkom.vercel.app
web-pi-umber.vercel.app
dev.web.online.ntnu.no
cb3ac6b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
rif – ./apps/rif
rif-two.vercel.app
rif-git-main-dotkom.vercel.app
rif-dotkom.vercel.app
dev.interesse.online.ntnu.no