Skip to content

Commit

Permalink
Fix navbar path and design (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigridge authored Oct 19, 2023
1 parent c35104e commit db65fd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/NavBar/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function NavBar() {
return (
<div className="bg-primary_default w-full h-[52px] flex flex-row justify-between sticky top-0 px-4">
<div className="flex flex-row">
<NavBarLink text="Bemanning" path="/" />
<NavBarLink text="Bemanning" path={`/bemanning`} />
</div>
<div className="flex flex-row gap-6 items-center">
<Image
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/NavBar/NavBarLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { usePathname } from "next/navigation";

export default function NavBarLink(props: { text: string; path: string }) {
const pathname = usePathname();
const isCurrentPath = props.path.includes(pathname);
const isCurrentPath = pathname.includes(props.path);
const orgUrl = pathname.split("/")[1] || "";

return (
<a
Expand All @@ -12,7 +13,7 @@ export default function NavBarLink(props: { text: string; path: string }) {
? "body-large-bold border-b-[3px] border-secondary_default"
: "body-large opacity-70 hover:opacity-100"
}`}
href={`${props.path}`}
href={`/${orgUrl}/${props.path}`}
>
{props.text}
</a>
Expand Down

0 comments on commit db65fd6

Please sign in to comment.