rsnext/examples/with-apollo-and-redux/components/Nav.js

32 lines
741 B
JavaScript
Raw Normal View History

import Link from 'next/link'
import { withRouter } from 'next/router'
const Nav = ({ router: { pathname } }) => (
<header>
Remove prefetch attributes from examples (#8481) * Remove prefetch from with-apollo-and-redux-saga example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from using-inferno example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from with-apollo-and-redux example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from with-apollo-auth example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from with-tailwindcss example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from with-graphql-hooks example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from data-fetch example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated
2019-08-23 16:12:25 +02:00
<Link href='/'>
<a className={pathname === '/' ? 'is-active' : ''}>Home</a>
</Link>
Remove prefetch attributes from examples (#8481) * Remove prefetch from with-apollo-and-redux-saga example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from using-inferno example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from with-apollo-and-redux example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from with-apollo-auth example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from with-tailwindcss example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from with-graphql-hooks example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from data-fetch example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated
2019-08-23 16:12:25 +02:00
<Link href='/apollo'>
<a className={pathname === '/apollo' ? 'is-active' : ''}>Apollo</a>
</Link>
Remove prefetch attributes from examples (#8481) * Remove prefetch from with-apollo-and-redux-saga example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from using-inferno example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from with-apollo-and-redux example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from with-apollo-auth example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from with-tailwindcss example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from with-graphql-hooks example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated * Remove prefetch from data-fetch example Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated
2019-08-23 16:12:25 +02:00
<Link href='/redux'>
<a className={pathname === '/redux' ? 'is-active' : ''}>Redux</a>
</Link>
<style jsx>{`
header {
margin-bottom: 25px;
}
a {
font-size: 14px;
margin-right: 15px;
text-decoration: none;
}
.is-active {
text-decoration: underline;
}
`}</style>
</header>
)
export default withRouter(Nav)