2017-03-30 18:21:13 +00:00
|
|
|
import Link from 'next/link'
|
2017-12-27 18:57:57 +00:00
|
|
|
import { withRouter } from 'next/router'
|
2017-03-30 18:21:13 +00:00
|
|
|
|
2017-12-27 18:57:57 +00:00
|
|
|
const Header = ({ router: { pathname } }) => (
|
2017-03-30 18:21:13 +00:00
|
|
|
<header>
|
|
|
|
<Link prefetch href='/'>
|
2017-12-27 18:57:57 +00:00
|
|
|
<a className={pathname === '/' ? 'is-active' : ''}>Home</a>
|
2017-03-30 18:21:13 +00:00
|
|
|
</Link>
|
|
|
|
<Link prefetch href='/about'>
|
2017-12-27 18:57:57 +00:00
|
|
|
<a className={pathname === '/about' ? 'is-active' : ''}>About</a>
|
2017-03-30 18:21:13 +00:00
|
|
|
</Link>
|
2017-11-23 13:05:51 +00:00
|
|
|
<Link prefetch href='/blog'>
|
2017-12-27 18:57:57 +00:00
|
|
|
<a className={pathname === '/blog' ? 'is-active' : ''}>Blog</a>
|
2017-11-23 13:05:51 +00:00
|
|
|
</Link>
|
2017-03-30 18:21:13 +00:00
|
|
|
<style jsx>{`
|
|
|
|
header {
|
|
|
|
margin-bottom: 25px;
|
|
|
|
}
|
|
|
|
a {
|
|
|
|
font-size: 14px;
|
|
|
|
margin-right: 15px;
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
.is-active {
|
|
|
|
text-decoration: underline;
|
|
|
|
}
|
|
|
|
`}</style>
|
|
|
|
</header>
|
|
|
|
)
|
2017-12-27 18:57:57 +00:00
|
|
|
|
|
|
|
export default withRouter(Header)
|