-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Make the navbar usable on mobile (#503)
- Loading branch information
Showing
3 changed files
with
73 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
"use client"; | ||
|
||
import { OrganisationReadModel } from "@/api-types"; | ||
import { useState } from "react"; | ||
import NavBarLink from "./NavBarLink"; | ||
import NavBarOrganisationDropdown from "./NavBarOrganisationDropdown"; | ||
import NavBarDropdown from "./NavBarDropdown"; | ||
import { Menu, X } from "react-feather"; | ||
|
||
export default function NavBarMobile({ | ||
orgs, | ||
initial, | ||
navBarLinks, | ||
}: { | ||
orgs: OrganisationReadModel[]; | ||
initial: string; | ||
navBarLinks: { text: string; path: string }[]; | ||
}) { | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
return ( | ||
<div className="flex flex-col w-full min-h-[55px] py-4"> | ||
<div className="flex justify-end"> | ||
<button className="text-white" onClick={() => setIsOpen(!isOpen)}> | ||
{isOpen ? <X className="h-4 w-4" /> : <Menu className="h-4 w-4" />} | ||
</button> | ||
</div> | ||
{isOpen && ( | ||
<div className="flex flex-col gap-2 items-center"> | ||
{navBarLinks.map((link, index) => ( | ||
<NavBarLink key={index} text={link.text} path={link.path} /> | ||
))} | ||
<NavBarOrganisationDropdown organisations={orgs} /> | ||
<NavBarDropdown initial={initial} /> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.