Open History to see the last commit
1import React from 'react'
2import { useRouter } from 'next/router'
3import Link from 'next/link'
4β
5export const Header = () => {
6 const { pathname } = useRouter()
7β
8 return (
9 <header>
10 <Link href="/">
11 <a className={pathname === '/' ? 'is-active' : ''}>Home</a>
12 </Link>
13 <Link href="/client-only">
14 <a className={pathname === '/client-only' ? 'is-active' : ''}>
15 Client-Only
16 </a>
17 </Link>
18 <style jsx>{`
19 header {
20 margin-bottom: 25px;
21 }
22 a {
23 font-size: 14px;
24 margin-right: 15px;
25 text-decoration: none;
26 }
27 .is-active {
28 text-decoration: underline;
29 }
30 `}</style>
31 </header>
32 )
33}