diff --git a/src/components/Navigation/DesktopNav.tsx b/src/components/Navigation/DesktopNav.tsx index 065589e..b71fa8d 100644 --- a/src/components/Navigation/DesktopNav.tsx +++ b/src/components/Navigation/DesktopNav.tsx @@ -30,7 +30,41 @@ const navLinks = [ export default function DesktopNav() { - const handleNavigation = (href) => { + interface NavLink { + name: string; + id_href: string; + cssClass: string; + } + + const navLinks: NavLink[] = [ + { + name: "Info", + id_href: "#info", + cssClass: "nav-text-animation", + }, + { + name: "Sponsors", + id_href: "#sponsors", + cssClass: "nav-text-animation", + }, + { + name: "Team", + id_href: "#team", + cssClass: "nav-text-animation", + }, + { + name: "Events", + id_href: "https://asu.campuslabs.com/engage/organization/soda/events", + cssClass: "nav-text-animation", + }, + { + name: "HackSoDA24", + id_href: "https://hack.thesoda.io", + cssClass: "nav-text-animation", + } + ]; + + const handleNavigation = (href: string): void => { if (href.startsWith("#")) { // Redirect to root and append the hash section window.location.href = `/${href}`; diff --git a/src/components/Navigation/Mobile/OpenedMobileNav.tsx b/src/components/Navigation/Mobile/OpenedMobileNav.tsx index 0d25cc1..3ea94d6 100644 --- a/src/components/Navigation/Mobile/OpenedMobileNav.tsx +++ b/src/components/Navigation/Mobile/OpenedMobileNav.tsx @@ -6,7 +6,11 @@ type setIsOpenTypes = { export default function OpenedMobileNav({ setIsOpen }: setIsOpenTypes) { - const handleNavigation = (href) => { + interface HandleNavigationProps { + (href: string): void; + } + + const handleNavigation: HandleNavigationProps = (href) => { if (href.startsWith("#")) { window.location.href = `/${href}`; } else { diff --git a/src/pages/LeaderBoard.tsx b/src/pages/LeaderBoard.tsx index 876aae5..a629474 100644 --- a/src/pages/LeaderBoard.tsx +++ b/src/pages/LeaderBoard.tsx @@ -16,7 +16,7 @@ interface LeaderboardEntry { const Leaderboard: React.FC = () => { const [leaderboardData, setLeaderboardData] = useState([]); const [loading, setLoading] = useState(true); - const [error, setError] = useState(null); + const [error, setError] = useState(null); const [currentPage, setCurrentPage] = useState(1); const [itemsPerPage, setItemsPerPage] = useState(10); const [searchTerm, setSearchTerm] = useState(''); @@ -31,7 +31,7 @@ const Leaderboard: React.FC = () => { const data: LeaderboardEntry[] = await response.json(); setLeaderboardData(data); } catch (error) { - setError(error.message); + setError((error as Error).message); } finally { setLoading(false); }