main-site/components/navbar.tsx

30 lines
870 B
TypeScript
Raw Permalink Normal View History

2022-12-03 20:02:13 +00:00
import styles from '/styles/Home.module.css'
import Link from 'next/link'
import { useRouter } from 'next/router'
const navLinks = [
{ name: "Home", href: "/" },
{ name: "About", href: "/about" },
{ name: "Games", href: "/games" },
{ name: "Services", href: "/services" }
]
const Navbar = () => {
const router = useRouter();
return (
<nav className={styles.navbar}>
{navLinks.map((item, index) => (
<Link key={item.name} href={item.href}>
<a className={router.pathname == item.href ? styles.navelem_active : styles.navelem}>{item.name}</a>
</Link>
))}
<Link key="Mastodon_Verify" href="https://mastodon.neshura-server.net/@neshura">
<a className={styles.navelem} rel="me" href="https://mastodon.neshura-server.net/@neshura">Mastodon</a>
</Link>
</nav>
);
}
export default Navbar;