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

refactor: move "Ferie" into navbar #555

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
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
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>
);
}
Loading