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>
|
2018-01-31 09:40:32 +00:00
|
|
|
<Link prefetch href='/apollo'>
|
|
|
|
<a className={pathname === '/apollo' ? 'is-active' : ''}>Apollo</a>
|
2017-03-30 18:21:13 +00:00
|
|
|
</Link>
|
2018-01-31 09:40:32 +00:00
|
|
|
<Link prefetch href='/redux'>
|
|
|
|
<a className={pathname === '/redux' ? 'is-active' : ''}>Redux</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)
|