fix navbar buttons
Some checks failed
Deploy / deploy (push) Has been cancelled

This commit is contained in:
Lee 2024-09-27 19:49:08 +01:00
parent ddfbe7e67b
commit ed61d8c8e6
2 changed files with 13 additions and 19 deletions

@ -33,6 +33,8 @@ const renderNavbarItem = (item: NavbarItem) => (
); );
export default function Navbar() { export default function Navbar() {
const rightItem = items[items.length - 1];
return ( return (
<div className="w-full sticky top-0 z-[999]"> <div className="w-full sticky top-0 z-[999]">
<div className="h-10 items-center flex justify-between bg-secondary/95"> <div className="h-10 items-center flex justify-between bg-secondary/95">
@ -41,18 +43,16 @@ export default function Navbar() {
<ProfileButton /> <ProfileButton />
{items.slice(0, -1).map((item, index) => ( {items.slice(0, -1).map((item, index) => (
<NavbarButton key={index}> <Link href={item.link} key={index} className="h-full">
<Link href={item.link}>{renderNavbarItem(item)}</Link> <NavbarButton key={index}>{renderNavbarItem(item)}</NavbarButton>
</NavbarButton> </Link>
))} ))}
</div> </div>
{/* Right-aligned item */} {/* Right-aligned item */}
<NavbarButton> <Link href={rightItem.link} className="h-full">
<Link href={items[items.length - 1].link}> <NavbarButton>{renderNavbarItem(rightItem)}</NavbarButton>
{renderNavbarItem(items[items.length - 1])}
</Link> </Link>
</NavbarButton>
</div> </div>
</div> </div>
); );

@ -19,19 +19,13 @@ export default function ProfileButton() {
} }
return ( return (
<Link href={`/player/${settings.playerId}`} className="flex items-center gap-2 h-full">
<NavbarButton> <NavbarButton>
<Link
href={`/player/${settings.playerId}`}
className="flex items-center gap-2"
>
<Avatar className="w-6 h-6"> <Avatar className="w-6 h-6">
<AvatarImage <AvatarImage alt="Profile Picture" src={`https://cdn.scoresaber.com/avatars/${settings.playerId}.jpg`} />
alt="Profile Picture"
src={`https://cdn.scoresaber.com/avatars/${settings.playerId}.jpg`}
/>
</Avatar> </Avatar>
<p>You</p> <p>You</p>
</Link>
</NavbarButton> </NavbarButton>
</Link>
); );
} }