1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/examples/with-tailwindcss/components/nav.js
Lucas Rosa fc335ac36c Add example with tailwind css (#3317)
* Add Tailwind css example

* Fix read me

* Add create-next-app setup to read me
2017-11-23 13:48:34 +01:00

61 lines
1.2 KiB
JavaScript

import Head from './head'
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>
<Link prefetch href="/">
<a>Home</a>
</Link>
</li>
<ul>
{links.map(
({ key, href, label }) => (
<li key={key}>
<Link href={href}>
<a className="btn-blue">{label}</a>
</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