diff --git a/frontend/components/Links.tsx b/frontend/components/Links.tsx index 1fc4f36..f92b189 100644 --- a/frontend/components/Links.tsx +++ b/frontend/components/Links.tsx @@ -1,8 +1,8 @@ +import Link from 'next/link'; import { useRouter } from 'next/router'; -import { useEffect, useState } from 'react'; +import { useEffect } from 'react'; import { ReactElement } from 'react-markdown/lib/react-markdown'; import { motion } from 'framer-motion'; -import Link from 'next/link'; export enum Route { Home, @@ -11,54 +11,35 @@ export enum Route { Blog, Events } - interface NavLinkProp { selectedRoute: Route; i: number; route: String | Route; } - -const NavLink = ({ selectedRoute, i, route }: NavLinkProp): ReactElement => { +const NavLink = ({selectedRoute,i,route}: NavLinkProp): ReactElement => { return ( - - - {route.toString()} - - + + + {route.toString()} + + ); }; - -const Links = (props: any): ReactElement => { +const Links = (props: any): ReactElement => { const router = useRouter(); const [selectedRoute, setSelectedRoute] = props.state; - const [isMobile, setIsMobile] = useState(false); - - useEffect(() => { - const handleResize = () => { - setIsMobile(window.innerWidth <= 768); - }; - - handleResize(); - - window.addEventListener('resize', handleResize); - - return () => window.removeEventListener('resize', handleResize); - }, []); useEffect(() => { switch (router.route) { @@ -87,19 +68,11 @@ const Links = (props: any): ReactElement => { return ( <> - {Object.values(Route).filter((v) => isNaN(Number(v))).map((route, i) =>isMobile ? - (
  • - - - {route.toString()} - - -
  • ) : ( ))} + {Object.values(Route).filter((v) => isNaN(Number(v))).map((route, i) => ( + // i + 5 to offset the delay + ))} ); }; -export default Links; +export default Links; \ No newline at end of file