rsnext/packages/create-next-app/templates/default/components/nav.js
Joe Haddad 104d18c607
Rewrite Create Next App (#8030)
* Completely rewrite Create Next App

* Sort imports

* Show what package manager is being used

* Fix project name suggestion

* Update tests for new implementation

* Use normal prepublish command for on-install

* Upgrade Node version

* Switch to 8.16

* Disable v8 cache

* Swap out update check package and fix CLI boot
2019-07-19 15:55:30 -04:00

56 lines
1.1 KiB
JavaScript

import React from 'react'
import Link from 'next/link'
const links = [
{ href: 'https://zeit.co/now', label: 'ZEIT' },
{ href: 'https://github.com/zeit/next.js', label: 'GitHub' }
].map(link => {
link.key = `nav-link-${link.href}-${link.label}`
return link
})
const Nav = () => (
<nav>
<ul>
<li>
<Link href='/'>
<a>Home</a>
</Link>
</li>
{links.map(({ key, href, label }) => (
<li key={key}>
<a href={href}>{label}</a>
</li>
))}
</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