Skip to content

Commit

Permalink
refactor: move "Ferie" into navbar (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
trulshj authored Dec 20, 2024
1 parent 02d3466 commit e4ff8ef
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 33 deletions.
1 change: 1 addition & 0 deletions frontend/src/components/NavBar/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default async function NavBar() {
{ text: "Kunder", path: "kunder" },
{ text: "Konsulenter", path: "konsulenter" },
{ text: "Rapporter", path: "rapport" },
{ text: "Ferie", path: "ferie" },
];

return (
Expand Down
55 changes: 22 additions & 33 deletions frontend/src/components/NavBar/NavBarDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,32 @@ export default function NavBarDropdown(props: { initial: string }) {
});

return (
<>
<div className="relative" ref={menuRef}>
<div className="relative" ref={menuRef}>
<button
className={`flex rounded-full border border-white/50 h-8 w-8 justify-center items-center ${
isOpen ? "bg-white" : "hover:bg-white/10 hover:border-white"
}`}
onClick={() => setIsOpen(!isOpen)}
>
<p className={`large ${isOpen ? "text-primary" : "text-white"}`}>
{props.initial}
</p>
</button>
<div
className={`absolute right-0 top-[48px] z-50 rounded-lg text-primary bg-white flex flex-col w-[138px] shadow-xl p-1 ${
!isOpen && "hidden"
}`}
>
<button
className={`flex rounded-full border border-white/50 h-8 w-8 justify-center items-center ${
isOpen ? "bg-white" : "hover:bg-white/10 hover:border-white"
}`}
onClick={() => setIsOpen(!isOpen)}
className="hover:bg-primary/10 px-3 py-2 rounded flex flex-row gap-3 items-center "
onClick={() => signOut()}
>
<p className={`large ${isOpen ? "text-primary" : "text-white"}`}>
{props.initial}
<LogOut className="w-6 h-6" />
<p className="h-6 flex items-center normal-semibold text-primary">
Logg ut
</p>
</button>
<div
className={`absolute right-0 top-[48px] z-50 rounded-lg text-primary bg-white flex flex-col w-[138px] shadow-xl p-1 ${
!isOpen && "hidden"
}`}
>
<Link
className="hover:bg-primary/10 px-3 py-2 rounded flex flex-row gap-3 items-center "
href={`/${orgUrl}/ferie`}
>
<Sun className="w-6 h-6" />
<p className="h-6 flex items-center normal-semibold text-primary">
Ferie
</p>
</Link>
<button
className="hover:bg-primary/10 px-3 py-2 rounded flex flex-row gap-3 items-center "
onClick={() => signOut()}
>
<LogOut className="w-6 h-6" />
<p className="h-6 flex items-center normal-semibold text-primary">
Logg ut
</p>
</button>
</div>
</div>
</>
</div>
);
}

0 comments on commit e4ff8ef

Please sign in to comment.