Skip to content

Commit de2dd8a

Browse files
committed
Add ASU CS Wiki link to Navbar and enhance link rendering with optional icons
1 parent 78929ff commit de2dd8a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/Navigation/Navbar.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,30 @@ function NavbarSection() {
1919
{ name: "Team", id_href: "/#team" },
2020
{ name: "History", id_href: "/#history" },
2121
{ name: "Leaderboard", id_href: "/leaderboard" },
22+
{ name: "ASU CS Wiki", id_href: "https://wiki.thesoda.io", icon: "↗" },
2223
];
2324

2425
const handleLogoClick = () => {
2526
window.scrollTo(0, 0);
2627
};
2728

28-
const renderNavLink = (item: { name: string; id_href: string }) => {
29+
const renderNavLink = (item: { name: string; id_href: string; icon?: string }) => {
2930
const handleClick = () => {
3031
setIsMenuOpen(false);
3132
};
3233
if (item.id_href.startsWith('/') && !item.id_href.includes('#')) {
3334
return (
34-
<Link key={item.name} to={item.id_href} className="text-white w-full" onClick={handleClick}>
35+
<Link key={item.name} to={item.id_href} className="text-white w-full flex items-center gap-1" onClick={handleClick}>
3536
{item.name}
37+
{item.icon && <span className="text-sm">{item.icon}</span>}
3638
</Link>
3739
);
3840
}
3941
const isExternal = item.id_href.startsWith('http');
4042
return (
41-
<a key={item.name} href={item.id_href} className="text-white w-full" onClick={handleClick} {...(isExternal ? { target: '_blank', rel: 'noopener noreferrer' } : {})}>
43+
<a key={item.name} href={item.id_href} className="text-white w-full flex items-center gap-1" onClick={handleClick} {...(isExternal ? { target: '_blank', rel: 'noopener noreferrer' } : {})}>
4244
{item.name}
45+
{item.icon && <span className="text-sm">{item.icon}</span>}
4346
</a>
4447
);
4548
};

0 commit comments

Comments
 (0)