2017-11-23 12:48:34 +00:00
|
|
|
import Link from 'next/link'
|
|
|
|
const links = [
|
|
|
|
{ href: 'https://github.com/segmentio/create-next-app', label: 'Github' }
|
|
|
|
].map(link => {
|
|
|
|
link.key = `nav-link-${link.href}-${link.label}`
|
|
|
|
return link
|
|
|
|
})
|
|
|
|
|
|
|
|
const Nav = () => (
|
|
|
|
<nav>
|
|
|
|
<ul>
|
|
|
|
<li>
|
2017-11-25 11:03:25 +00:00
|
|
|
<Link prefetch href='/'>
|
2017-11-23 12:48:34 +00:00
|
|
|
<a>Home</a>
|
|
|
|
</Link>
|
|
|
|
</li>
|
|
|
|
<ul>
|
|
|
|
{links.map(
|
|
|
|
({ key, href, label }) => (
|
|
|
|
<li key={key}>
|
|
|
|
<Link href={href}>
|
2017-11-25 11:03:25 +00:00
|
|
|
<a className='btn-blue'>{label}</a>
|
2017-11-23 12:48:34 +00:00
|
|
|
</Link>
|
|
|
|
</li>
|
|
|
|
)
|
|
|
|
)}
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<style jsx>{`
|
|
|
|
:global(body) {
|
|
|
|
margin: 0;
|
|
|
|
font-family: -apple-system,BlinkMacSystemFont,Avenir Next,Avenir,Helvetica,sans-serif;
|
|
|
|
}
|
|
|
|
nav {
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
ul {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
|
|
|
nav > ul {
|
|
|
|
padding: 4px 16px;
|
|
|
|
}
|
|
|
|
li {
|
|
|
|
display: flex;
|
|
|
|
padding: 6px 8px;
|
|
|
|
}
|
|
|
|
a {
|
|
|
|
color: #067df7;
|
|
|
|
text-decoration: none;
|
|
|
|
font-size: 13px;
|
|
|
|
}
|
|
|
|
`}</style>
|
|
|
|
</nav>
|
|
|
|
)
|
|
|
|
|
|
|
|
export default Nav
|