Unverified Commit ab42da06 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Run next/link codemod for Next.js 13 on examples (#41913)

parent 8ada894a
......@@ -52,7 +52,7 @@ const ActiveLink = ({
])
return (
<Link {...props}>
<Link {...props} legacyBehavior>
{React.cloneElement(child, {
className: className || null,
})}
......
......@@ -12,9 +12,7 @@ const Index: NextPage<IndexProps> = ({ name }) => {
<h1>Home Page</h1>
<p>Welcome, {name}</p>
<div>
<Link href="/about">
<a>About Page</a>
</Link>
<Link href="/about">About Page</Link>
</div>
</div>
)
......
......@@ -3,11 +3,7 @@ import Link from 'next/link'
export default function About() {
return (
<div>
Welcome to the about page. Go to the{' '}
<Link href="/">
<a>Home</a>
</Link>{' '}
page.
Welcome to the about page. Go to the <Link href="/">Home</Link> page.
</div>
)
}
......@@ -32,14 +32,8 @@ const Index = () => {
if (viewer) {
return (
<div>
You're signed in as {viewer.email} goto{' '}
<Link href="/about">
<a>about</a>
</Link>{' '}
page. or{' '}
<Link href="/signout">
<a>signout</a>
</Link>
You're signed in as {viewer.email} goto <Link href="/about">about</Link>{' '}
page. or <Link href="/signout">signout</Link>
</div>
)
}
......
......@@ -65,9 +65,7 @@ function SignIn() {
label="Password"
/>
<button type="submit">Sign in</button> or{' '}
<Link href="/signup">
<a>Sign up</a>
</Link>
<Link href="/signup">Sign up</Link>
</form>
</>
)
......
......@@ -60,9 +60,7 @@ function SignUp() {
label="Password"
/>
<button type="submit">Sign up</button> or{' '}
<Link href="/signin">
<a>Sign in</a>
</Link>
<Link href="/signin">Sign in</Link>
</form>
</>
)
......
......@@ -3,11 +3,7 @@ import Link from 'next/link'
export default function About() {
return (
<div>
This is a static page goto{' '}
<Link href="/">
<a>dynamic</a>
</Link>{' '}
page.
This is a static page goto <Link href="/">dynamic</Link> page.
</div>
)
}
......@@ -21,10 +21,7 @@ const Index = () => {
return (
<div>
You're signed in as {viewer.name} and you're {viewer.status} goto{' '}
<Link href="/about">
<a>static</a>
</Link>{' '}
page.
<Link href="/about">static</Link> page.
</div>
)
}
......
......@@ -10,7 +10,7 @@ export default function UserListing({ users }) {
{users.map((user) => (
<li key={user.username}>
<Link href="/[username]" as={`/${user.username}`}>
<a>{user.name}</a>
{user.name}
</Link>
</li>
))}
......
......@@ -14,7 +14,7 @@ export default function Index() {
<ul>
{data.map((user) => (
<li key={user.id}>
<Link href="/user/[id]" as={`/user/${user.id}`}>
<Link href="/user/[id]" as={`/user/${user.id}`} legacyBehavior>
{`User ${user.id}`}
</Link>
</li>
......
......@@ -9,7 +9,7 @@ export default function PersonComponent({ person }: PersonProps) {
return (
<li>
<Link href="/person/[id]" as={`/person/${person.id}`}>
<a>{person.name}</a>
{person.name}
</Link>
</li>
)
......
......@@ -11,17 +11,17 @@ const Header = ({ user, loading }: HeaderProps) => {
<nav>
<ul>
<li>
<Link href="/">
<Link href="/" legacyBehavior>
<a>Home</a>
</Link>
</li>
<li>
<Link href="/about">
<Link href="/about" legacyBehavior>
<a>About</a>
</Link>
</li>
<li>
<Link href="/advanced/api-profile">
<Link href="/advanced/api-profile" legacyBehavior>
<a>API rendered profile (advanced)</a>
</Link>
</li>
......@@ -29,12 +29,12 @@ const Header = ({ user, loading }: HeaderProps) => {
(user ? (
<>
<li>
<Link href="/profile">
<Link href="/profile" legacyBehavior>
<a>Client rendered profile</a>
</Link>
</li>
<li>
<Link href="/advanced/ssr-profile">
<Link href="/advanced/ssr-profile" legacyBehavior>
<a>Server rendered profile (advanced)</a>
</Link>
</li>
......
......@@ -3,10 +3,7 @@ import Link from 'next/link'
const Home = () => {
return (
<div>
Hello World.{' '}
<Link href="/about">
<a>About</a>
</Link>
Hello World. <Link href="/about">About</Link>
</div>
)
}
......
......@@ -20,8 +20,8 @@ const CoverImage = ({ title, src, slug }: Props) => {
return (
<div className="sm:mx-0">
{slug ? (
<Link as={`/posts/${slug}`} href="/posts/[slug]">
<a aria-label={title}>{image}</a>
<Link as={`/posts/${slug}`} href="/posts/[slug]" aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
const Header = () => {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -29,8 +29,12 @@ const HeroPost = ({
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-5xl leading-tight">
<Link as={`/posts/${slug}`} href="/posts/[slug]">
<a className="hover:underline">{title}</a>
<Link
as={`/posts/${slug}`}
href="/posts/[slug]"
className="hover:underline"
>
{title}
</Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
......
......@@ -27,8 +27,12 @@ const PostPreview = ({
<CoverImage slug={slug} title={title} src={coverImage} />
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link as={`/posts/${slug}`} href="/posts/[slug]">
<a className="hover:underline">{title}</a>
<Link
as={`/posts/${slug}`}
href="/posts/[slug]"
className="hover:underline"
>
{title}
</Link>
</h3>
<div className="text-lg mb-4">
......
......@@ -12,8 +12,12 @@ export default function NotePage({
{allPosts.length ? (
allPosts.map((post) => (
<article key={post.slug} className="mb-10">
<Link as={`/posts/${post.slug}`} href="/posts/[slug]">
<a className="text-lg leading-6 font-bold">{post.title}</a>
<Link
as={`/posts/${post.slug}`}
href="/posts/[slug]"
className="text-lg leading-6 font-bold"
>
{post.title}
</Link>
<p>{post.excerpt}</p>
<div className="text-gray-400">
......
......@@ -16,8 +16,8 @@ export default function CoverImage({ title, responsiveImage, slug = null }) {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={`/posts/${slug}`}>
<a aria-label={title}>{image}</a>
<Link href={`/posts/${slug}`} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -23,8 +23,8 @@ export default function HeroPost({
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-6xl leading-tight">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
......
......@@ -21,8 +21,8 @@ export default function PostPreview({
/>
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="text-lg mb-4">
......
......@@ -18,8 +18,8 @@ export default function CoverImage({ title, url, slug }) {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={`/posts/${slug}`}>
<a aria-label={title}>{image}</a>
<Link href={`/posts/${slug}`} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -19,8 +19,8 @@ export default function HeroPost({
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-6xl leading-tight">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
......
......@@ -17,8 +17,8 @@ export default function PostPreview({
<CoverImage title={title} slug={slug} url={coverImage} />
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="text-lg mb-4">
......
......@@ -15,8 +15,8 @@ export default function Blog({ posts }) {
simple to launch a new company blog.
</p>
<p>
<Link href={`/blog`}>
<a className="main-btn btn-hover mt-5">View All Blog Posts</a>
<Link href={`/blog`} className="main-btn btn-hover mt-5">
View All Blog Posts
</Link>
</p>
</div>
......
......@@ -8,7 +8,7 @@ export default function CategoriesWidget({ categories }) {
{categories.map((category) => (
<li key={category.slug}>
<Link href={`/blog/category/${category.slug}`}>
<a>{category.name}</a>
{category.name}
</Link>
</li>
))}
......
......@@ -23,15 +23,13 @@ export default function PostPreviewCondensed({
)}
<div className="blog-body">
<h5 className="package-name">
<Link href={`/blog/${slug}`}>
<a>{title}</a>
</Link>
<Link href={`/blog/${slug}`}>{title}</Link>
</h5>
<p>{excerpt}</p>
</div>
<div className="blog-footer">
<Link href={`/blog/${slug}`}>
<a className="main-btn btn-hover">Read More</a>
<Link href={`/blog/${slug}`} className="main-btn btn-hover">
Read More
</Link>
</div>
</div>
......
......@@ -19,9 +19,7 @@ export default function PostsPreview({
<div className="blog-roll-card">
<div className="blog-roll-card-meta">
<h2 className="blog-roll-card-header">
<Link href={`/blog/${slug}`}>
<a>{title}</a>
</Link>
<Link href={`/blog/${slug}`}>{title}</Link>
</h2>
<ul className="blog-roll-card-meta-info">
<li>
......@@ -34,9 +32,7 @@ export default function PostsPreview({
{tags.map((tag) => (
<li key={tag.slug}>
<Link href={`/blog/tag/${tag.slug}`}>
<a>
<i className="lni lni-tag"></i> {tag.name}
</a>
<i className="lni lni-tag"></i> {tag.name}
</Link>
</li>
))}
......@@ -57,8 +53,8 @@ export default function PostsPreview({
dangerouslySetInnerHTML={{ __html: excerpt }}
></div>
<div className="blog-roll-card-footer text-center">
<Link href={`/blog/${slug}`}>
<a className="main-btn btn-hover">Read More</a>
<Link href={`/blog/${slug}`} className="main-btn btn-hover">
Read More
</Link>
</div>
</div>
......
......@@ -19,9 +19,7 @@ export default function Blog({ posts, categories }) {
<h2>All Blog Posts</h2>
<ul className="breadcrumb-nav">
<li>
<Link href="/">
<a>Home</a>
</Link>
<Link href="/">Home</Link>
</li>
<li>All blog posts</li>
</ul>
......
......@@ -55,14 +55,10 @@ export default function BlogPost({ post, categories }) {
<h2>{post.title}</h2>
<ul className="breadcrumb-nav">
<li>
<Link href="/">
<a>Home</a>
</Link>
<Link href="/">Home</Link>
</li>
<li>
<Link href="/blog">
<a>Blog</a>
</Link>
<Link href="/blog">Blog</Link>
</li>
<li>{post.title}</li>
</ul>
......@@ -92,9 +88,7 @@ export default function BlogPost({ post, categories }) {
{post.tags.map((tag) => (
<li key={tag.slug}>
<Link href={`/blog/tag/${tag.slug}`}>
<a>
<i className="lni lni-tag"></i> {tag.name}
</a>
<i className="lni lni-tag"></i> {tag.name}
</Link>
</li>
))}
......
......@@ -19,14 +19,10 @@ export default function Category({ posts, categories, slug }) {
<h2>Blog Posts by Category</h2>
<ul className="breadcrumb-nav">
<li>
<Link href="/">
<a>Home</a>
</Link>
<Link href="/">Home</Link>
</li>
<li>
<Link href="/blog">
<a>Blog</a>
</Link>
<Link href="/blog">Blog</Link>
</li>
<li>Category: {slug}</li>
</ul>
......
......@@ -19,14 +19,10 @@ export default function Search({ posts, categories, query }) {
<h2>Search Results</h2>
<ul className="breadcrumb-nav">
<li>
<Link href="/">
<a>Home</a>
</Link>
<Link href="/">Home</Link>
</li>
<li>
<Link href="/blog">
<a>Blog</a>
</Link>
<Link href="/blog">Blog</Link>
</li>
<li>Search: &#34;{query}&#34;</li>
</ul>
......
......@@ -19,14 +19,10 @@ export default function Tag({ posts, categories, slug }) {
<h2>Blog Posts by Tag</h2>
<ul className="breadcrumb-nav">
<li>
<Link href="/">
<a>Home</a>
</Link>
<Link href="/">Home</Link>
</li>
<li>
<Link href="/blog">
<a>Blog</a>
</Link>
<Link href="/blog">Blog</Link>
</li>
<li>Tag: {slug}</li>
</ul>
......
......@@ -18,8 +18,8 @@ export default function CoverImage({ title, url, slug }) {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={`/posts/${slug}`}>
<a aria-label={title}>{image}</a>
<Link href={`/posts/${slug}`} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -19,8 +19,8 @@ export default function HeroPost({
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-6xl leading-tight">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
......
......@@ -17,8 +17,8 @@ export default function PostPreview({
<CoverImage title={title} slug={slug} url={coverImage.url} />
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="text-lg mb-4">
......
......@@ -31,8 +31,8 @@ const CoverImage = (props: CoverImageProps) => {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={`/posts/${slug}`}>
<a aria-label={title}>{image}</a>
<Link href={`/posts/${slug}`} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
const Header = () => {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -24,8 +24,8 @@ const HeroPost = (props: HeroPostProps) => {
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-6xl leading-tight">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
......
......@@ -22,8 +22,8 @@ const PostPreview = (props: PostPreviewProps) => {
<CoverImage slug={slug} title={title} url={coverImage.imgix_url} />
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="text-lg mb-4">
......
......@@ -17,8 +17,8 @@ export default function CoverImage({ title, responsiveImage, slug }) {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={`/posts/${slug}`}>
<a aria-label={title}>{image}</a>
<Link href={`/posts/${slug}`} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -23,8 +23,8 @@ export default function HeroPost({
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-6xl leading-tight">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
......
......@@ -21,8 +21,8 @@ export default function PostPreview({
/>
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="text-lg mb-4">
......
......@@ -14,7 +14,7 @@ export const DotLink = ({ attrs: { href, target }, children }) => {
{children}
</a>
) : (
<Link href={href} target={target || '_self'}>
<Link href={href} target={target || '_self'} legacyBehavior>
{children}
</Link>
)
......
......@@ -16,8 +16,8 @@ export default function CoverImage(props) {
return (
<div className="-mx-5 sm:mx-0">
{props.slug ? (
<Link href={`/posts/${props.slug}`}>
<a aria-label={props.title}>{image}</a>
<Link href={`/posts/${props.slug}`} aria-label={props.title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -32,8 +32,12 @@ export default function HeroPost({
<div className="md:grid md:grid-cols-2 md:gap-16 lg:col-gap-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl leading-tight lg:text-6xl">
<Link as={`/posts/${slug}`} href="/posts/[slug]">
<a className="hover:underline">{title}</a>
<Link
as={`/posts/${slug}`}
href="/posts/[slug]"
className="hover:underline"
>
{title}
</Link>
</h3>
<div className="mb-4 text-lg md:mb-0">
......
......@@ -25,8 +25,8 @@ export default function PostPreview({
/>
</div>
<h3 className="mb-3 text-3xl leading-snug">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
{date !== 'now' ? (
......
......@@ -17,8 +17,8 @@ export default function CoverImage({ title, coverImage, slug }) {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={slug}>
<a aria-label={title}>{image}</a>
<Link href={slug} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -21,12 +21,11 @@ export default function HeroPost({
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-6xl leading-tight">
<Link href={slug}>
<a
className="hover:underline"
dangerouslySetInnerHTML={{ __html: title }}
/>
</Link>
<Link
href={slug}
className="hover:underline"
dangerouslySetInnerHTML={{ __html: title }}
></Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
<Date dateString={date} />
......
......@@ -17,12 +17,11 @@ export default function PostPreview({
<CoverImage title={title} coverImage={coverImage} slug={slug} />
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link href={slug}>
<a
className="hover:underline"
dangerouslySetInnerHTML={{ __html: title }}
></a>
</Link>
<Link
href={slug}
className="hover:underline"
dangerouslySetInnerHTML={{ __html: title }}
></Link>
</h3>
<div className="text-lg mb-4">
<Date dateString={date} />
......
......@@ -23,8 +23,8 @@ export default function CoverImage({ title, coverImage, slug }: Props) {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={`/posts${slug}`}>
<a aria-label={title}>{image}</a>
<Link href={`/posts${slug}`} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -31,12 +31,11 @@ export default function HeroPost({
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-6xl leading-tight">
<Link href={`/posts${slug}`}>
<a
className="hover:underline"
dangerouslySetInnerHTML={{ __html: title }}
/>
</Link>
<Link
href={`/posts${slug}`}
className="hover:underline"
dangerouslySetInnerHTML={{ __html: title }}
></Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
<Date dateString={date} />
......
......@@ -29,8 +29,8 @@ export default function PostPreview({
)}
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link href={`/posts${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="text-lg mb-4">
......
......@@ -18,8 +18,8 @@ export default function CoverImage({ title, url, slug, width, height }) {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={`/posts/${slug}`}>
<a aria-label={title}>{image}</a>
<Link href={`/posts/${slug}`} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -25,8 +25,8 @@ export default function HeroPost({
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-6xl leading-tight">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
......
......@@ -23,8 +23,8 @@ export default function PostPreview({
/>
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="text-lg mb-4">
......
......@@ -18,8 +18,8 @@ export default function CoverImage({ title, url, slug }) {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={`/posts/${slug}`}>
<a aria-label={title}>{image}</a>
<Link href={`/posts/${slug}`} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -19,8 +19,8 @@ export default function HeroPost({
<div className="mb-20 md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 md:mb-28">
<div>
<h3 className="mb-4 text-4xl leading-tight lg:text-6xl">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 text-lg md:mb-0">
......
......@@ -17,8 +17,8 @@ export default function PostPreview({
<CoverImage slug={slug} title={title} url={coverImage.url} />
</div>
<h3 className="mb-3 text-3xl leading-snug">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 text-lg">
......
......@@ -27,27 +27,26 @@ export default function Home({ posts }) {
posts.map((post) => (
<li key={post.id} className={styles.card}>
<Link href={`/post/${post.slug}`}>
<a>
<h2>{post.title}</h2>
<p>Read now &rarr;</p>
</a>
<h2>{post.title}</h2>
<p>Read now &rarr;</p>
</Link>
</li>
))
) : (
<li className={`${styles.noposts} ${styles.card}`}>
<Link href="http://localhost:8000">
<a>
<h2>No Posts</h2>
<p>Add one via the Admin UI &rarr;</p>
</a>
<h2>No Posts</h2>
<p>Add one via the Admin UI &rarr;</p>
</Link>
</li>
)}
</ul>
{process.env.NODE_ENV !== 'production' && (
<Link href="/api/graphql?query=%7BallPosts%7Btitle%2Cslug%2Ccontent%7D%7D">
<a className={styles.playground}>Visit the graphql playground</a>
<Link
href="/api/graphql?query=%7BallPosts%7Btitle%2Cslug%2Ccontent%7D%7D"
className={styles.playground}
>
Visit the graphql playground
</Link>
)}
</main>
......
......@@ -6,9 +6,7 @@ export default function Home({ post }) {
<div>
<main style={{ margin: '3rem' }}>
<div>
<Link href="/">
<a>&larr; back home</a>
</Link>
<Link href="/">&larr; back home</Link>
</div>
<h1>{post.title}</h1>
<p>{post.content}</p>
......
......@@ -17,8 +17,8 @@ export default function CoverImage({ title, src, slug }) {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={`/posts/${slug}`}>
<a aria-label={title}>{image}</a>
<Link href={`/posts/${slug}`} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -19,8 +19,8 @@ export default function HeroPost({
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-6xl leading-tight">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
......
......@@ -17,8 +17,8 @@ export default function PostPreview({
<CoverImage slug={slug} title={title} src={coverImage} />
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="text-lg mb-4">
......
......@@ -18,8 +18,8 @@ export default function CoverImage({ title, url, slug }) {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={`/posts/${slug}`}>
<a aria-label={title}>{image}</a>
<Link href={`/posts/${slug}`} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -19,8 +19,8 @@ export default function HeroPost({
<div className="mb-20 md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 md:mb-28">
<div>
<h3 className="mb-4 text-4xl leading-tight lg:text-6xl">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 text-lg md:mb-0">
......
......@@ -17,8 +17,8 @@ export default function PostPreview({
<CoverImage slug={slug} title={title} url={coverImage} />
</div>
<h3 className="mb-3 text-3xl leading-snug">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 text-lg">
......
......@@ -29,8 +29,8 @@ export default function CoverImage({
return (
<div className="sm:mx-0">
{href ? (
<Link href={href}>
<a aria-label={title}>{image}</a>
<Link href={href} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -34,10 +34,8 @@ export default function HeroPost({
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-6xl leading-tight">
<Link href={href}>
<a className="hover:underline">
<PrismicText field={title} />
</a>
<Link href={href} className="hover:underline">
<PrismicText field={title} />
</Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
......
......@@ -33,10 +33,8 @@ export default function PostPreview({
<CoverImage title={asText(title)} href={href} image={coverImage} />
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link href={href}>
<a className="hover:underline">
<PrismicText field={title} />
</a>
<Link href={href} className="hover:underline">
<PrismicText field={title} />
</Link>
</h3>
<div className="text-lg mb-4">
......
......@@ -28,8 +28,8 @@ export default function CoverImage({ title, slug, image: source, priority }) {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={`/posts/${slug}`}>
<a aria-label={title}>{image}</a>
<Link href={`/posts/${slug}`} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -19,8 +19,8 @@ export default function HeroPost({
<div className="mb-20 md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 md:mb-28">
<div>
<h3 className="mb-4 text-4xl leading-tight lg:text-6xl">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 text-lg md:mb-0">
......
......@@ -17,8 +17,8 @@ export default function PostPreview({
<CoverImage slug={slug} title={title} image={coverImage} />
</div>
<h3 className="mb-3 text-3xl leading-snug">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 text-lg">
......
......@@ -20,8 +20,8 @@ const CoverImage = ({ title, src, slug }: Props) => {
return (
<div className="sm:mx-0">
{slug ? (
<Link as={`/posts${slug}`} href="/posts[slug]">
<a aria-label={title}>{image}</a>
<Link as={`/posts${slug}`} href="/posts[slug]" aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
const Header = () => {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -29,8 +29,12 @@ const HeroPost = ({
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-5xl leading-tight">
<Link as={`/posts${slug}`} href="/posts[slug]">
<a className="hover:underline">{title}</a>
<Link
as={`/posts${slug}`}
href="/posts[slug]"
className="hover:underline"
>
{title}
</Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
......
......@@ -27,8 +27,12 @@ const PostPreview = ({
<CoverImage slug={slug} title={title} src={coverImage} />
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link as={`/posts${slug}`} href="/posts[slug]">
<a className="hover:underline">{title}</a>
<Link
as={`/posts${slug}`}
href="/posts[slug]"
className="hover:underline"
>
{title}
</Link>
</h3>
<div className="text-lg mb-4">
......
......@@ -17,8 +17,8 @@ export default function CoverImage({ title, url, slug }) {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={slug}>
<a aria-label={title}>{image}</a>
<Link href={slug} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -19,8 +19,8 @@ export default function HeroPost({
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-6xl leading-tight">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
......
......@@ -17,8 +17,8 @@ export default function PostPreview({
<CoverImage slug={slug} title={title} url={coverImage} />
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="text-lg mb-4">
......
......@@ -21,8 +21,8 @@ export default function CoverImage({ title, url, slug }) {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={`/posts/${slug}`}>
<a aria-label={title}>{image}</a>
<Link href={`/posts/${slug}`} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -19,8 +19,8 @@ export default function HeroPost({
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-6xl leading-tight">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
......
......@@ -17,8 +17,8 @@ export default function PostPreview({
<CoverImage slug={slug} title={title} url={coverImage.url} />
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="text-lg mb-4">
......
......@@ -23,8 +23,8 @@ export default function CoverImage({ title, coverImage, slug }) {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={slug}>
<a aria-label={title}>{image}</a>
<Link href={slug} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -19,8 +19,8 @@ export default function HeroPost({
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-6xl leading-tight">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
......
......@@ -17,8 +17,8 @@ export default function PostPreview({
<CoverImage slug={slug} title={title} coverImage={coverImage} />
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="text-lg mb-4">
......
......@@ -18,8 +18,8 @@ export default function CoverImage({ title, src, slug, height, width }) {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={`/posts/${slug}`}>
<a aria-label={title}>{image}</a>
<Link href={`/posts/${slug}`} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -25,8 +25,8 @@ export default function HeroPost({
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-6xl leading-tight">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
......
......@@ -23,8 +23,8 @@ export default function PostPreview({
/>
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="text-lg mb-4">
......
......@@ -18,8 +18,8 @@ export default function CoverImage({ title, url, slug }) {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={slug}>
<a aria-label={title}>{image}</a>
<Link href={slug} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -19,8 +19,8 @@ export default function HeroPost({
<div className="mb-20 md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 md:mb-28">
<div>
<h3 className="mb-4 text-4xl leading-tight lg:text-6xl">
<Link href={slug}>
<a className="hover:underline">{title}</a>
<Link href={slug} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 text-lg md:mb-0">
......
......@@ -17,8 +17,8 @@ export default function PostPreview({
<CoverImage slug={slug} title={title} url={coverImage.url} />
</div>
<h3 className="mb-3 text-3xl leading-snug">
<Link href={slug}>
<a className="hover:underline">{title}</a>
<Link href={slug} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 text-lg">
......
......@@ -32,8 +32,8 @@ const CoverImage: React.FC<TCoverImage> = ({
return (
<div className="sm:mx-0">
{slug ? (
<Link href={`/posts/${slug}`}>
<a aria-label={title}>{image}</a>
<Link href={`/posts/${slug}`} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="mt-8 mb-20 text-2xl font-bold leading-tight tracking-tight md:text-4xl md:tracking-tighter">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -25,8 +25,8 @@ export default function HeroPost({
<div className="mb-20 md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 md:mb-28">
<div>
<h3 className="mb-4 text-4xl leading-tight lg:text-6xl">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 text-lg md:mb-0">
......
......@@ -23,8 +23,8 @@ export default function PostPreview({
/>
</div>
<h3 className="mb-3 text-3xl leading-snug">
<Link href={`/posts/${slug}`}>
<a className="hover:underline">{title}</a>
<Link href={`/posts/${slug}`} className="hover:underline">
{title}
</Link>
</h3>
<div className="mb-4 text-lg">
......
......@@ -27,8 +27,8 @@ export default function CoverImage({ title, coverImage, slug }: Props) {
return (
<div className="sm:mx-0">
{slug ? (
<Link href={`/posts/${slug}`}>
<a aria-label={title}>{image}</a>
<Link href={`/posts/${slug}`} aria-label={title}>
{image}
</Link>
) : (
image
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
export default function Header() {
return (
<h2 className="text-2xl md:text-4xl font-bold tracking-tight md:tracking-tighter leading-tight mb-20 mt-8">
<Link href="/">
<a className="hover:underline">Blog</a>
<Link href="/" className="hover:underline">
Blog
</Link>
.
</h2>
......
......@@ -21,12 +21,11 @@ export default function HeroPost({
<div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div>
<h3 className="mb-4 text-4xl lg:text-6xl leading-tight">
<Link href={`/posts/${slug}`}>
<a
className="hover:underline"
dangerouslySetInnerHTML={{ __html: title }}
/>
</Link>
<Link
href={`/posts/${slug}`}
className="hover:underline"
dangerouslySetInnerHTML={{ __html: title }}
></Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
<Date dateString={date} />
......
......@@ -19,12 +19,11 @@ export default function PostPreview({
)}
</div>
<h3 className="text-3xl mb-3 leading-snug">
<Link href={`/posts/${slug}`}>
<a
className="hover:underline"
dangerouslySetInnerHTML={{ __html: title }}
></a>
</Link>
<Link
href={`/posts/${slug}`}
className="hover:underline"
dangerouslySetInnerHTML={{ __html: title }}
></Link>
</h3>
<div className="text-lg mb-4">
<Date dateString={date} />
......
......@@ -5,12 +5,12 @@ export default function Home() {
<ul>
<li>
<Link href="/b" as="/a">
<a>a</a>
a
</Link>
</li>
<li>
<Link href="/a" as="/b">
<a>b</a>
b
</Link>
</li>
</ul>
......
......@@ -5,12 +5,12 @@ export default function Home() {
<ul>
<li>
<Link href="/b" as="/a">
<a>a</a>
a
</Link>
</li>
<li>
<Link href="/a" as="/b">
<a>b</a>
b
</Link>
</li>
</ul>
......
......@@ -5,12 +5,12 @@ export default function Home() {
<ul>
<li>
<Link href="/b" as="/a">
<a>a</a>
a
</Link>
</li>
<li>
<Link href="/a" as="/b">
<a>b</a>
b
</Link>
</li>
</ul>
......
......@@ -6,12 +6,12 @@ export default function Home() {
<ul>
<li>
<Link href="/b" as="/a">
<a>a</a>
a
</Link>
</li>
<li>
<Link href="/a" as="/b">
<a>b</a>
b
</Link>
</li>
</ul>
......
......@@ -4,14 +4,10 @@ export default function Home() {
return (
<ul>
<li>
<Link href="/a">
<a>a</a>
</Link>
<Link href="/a">a</Link>
</li>
<li>
<Link href="/b">
<a>b</a>
</Link>
<Link href="/b">b</Link>
</li>
</ul>
)
......
......@@ -5,12 +5,12 @@ export default function Home() {
<ul>
<li>
<Link href="/b" as="/a">
<a>a</a>
a
</Link>
</li>
<li>
<Link href="/a" as="/b">
<a>b</a>
b
</Link>
</li>
</ul>
......
......@@ -18,9 +18,7 @@ export default function IndexPage({
return (
<>
<p>Next.js has {stars} ⭐️</p>
<Link href="/preact-stars">
<a>How about preact?</a>
</Link>
<Link href="/preact-stars">How about preact?</Link>
</>
)
}
......@@ -18,9 +18,7 @@ export default function PreactStarsPage({
return (
<>
<p>Preact has {stars} ⭐</p>
<Link href="/">
<a>I bet Next.js has more stars (?)</a>
</Link>
<Link href="/">I bet Next.js has more stars (?)</Link>
</>
)
}
......@@ -5,24 +5,16 @@ export default function Header() {
<header>
<ul>
<li>
<Link href="/">
<a>Home</a>
</Link>
<Link href="/">Home</Link>
</li>
<li>
<Link href="/about">
<a>About</a>
</Link>
<Link href="/about">About</Link>
</li>
<li>
<Link href="/post/first">
<a>First Post</a>
</Link>
<Link href="/post/first">First Post</Link>
</li>
<li>
<Link href="/post/second">
<a>Second Post</a>
</Link>
<Link href="/post/second">Second Post</Link>
</li>
</ul>
</header>
......
......@@ -12,14 +12,10 @@ export default function PostPage() {
<h1>Post: {id}</h1>
<ul>
<li>
<Link href={`/post/${id}/first-comment`}>
<a>First comment</a>
</Link>
<Link href={`/post/${id}/first-comment`}>First comment</Link>
</li>
<li>
<Link href={`/post/${id}/second-comment`}>
<a>Second comment</a>
</Link>
<Link href={`/post/${id}/second-comment`}>Second comment</Link>
</li>
</ul>
</>
......
......@@ -10,7 +10,10 @@ export default function Index() {
<hr className={styles.hr} />
<p>
The links below are examples of{' '}
<Link href="https://nextjs.org/docs/api-reference/next.config.js/headers">
<Link
href="https://nextjs.org/docs/api-reference/next.config.js/headers"
legacyBehavior
>
<>
custom <Code>headers</Code>
</>
......
......@@ -3,10 +3,7 @@ import Link from 'next/link'
export default function IndexPage() {
return (
<div>
Hello World.{' '}
<Link href="/about">
<a>About</a>
</Link>
Hello World. <Link href="/about">About</Link>
</div>
)
}
......@@ -17,7 +17,12 @@ export default function LocaleSwitcher() {
const { pathname, query, asPath } = router
return (
<li key={locale}>
<Link href={{ pathname, query }} as={asPath} locale={locale}>
<Link
href={{ pathname, query }}
as={asPath}
locale={locale}
legacyBehavior
>
{locale}
</Link>
</li>
......
......@@ -36,34 +36,22 @@ const Index = () => (
</p>
<ul>
<li>
<Link href="/responsive">
<a>Responsive to viewport</a>
</Link>
<Link href="/responsive">Responsive to viewport</Link>
</li>
<li>
<Link href="/fill">
<a>Fill dimensions of parent element</a>
</Link>
<Link href="/fill">Fill dimensions of parent element</Link>
</li>
<li>
<Link href="/placeholder">
<a>Blur-up placeholder</a>
</Link>
<Link href="/placeholder">Blur-up placeholder</Link>
</li>
<li>
<Link href="/shimmer">
<a>Shimmer placeholder</a>
</Link>
<Link href="/shimmer">Shimmer placeholder</Link>
</li>
<li>
<Link href="/color">
<a>Color placeholder</a>
</Link>
<Link href="/color">Color placeholder</Link>
</li>
<li>
<Link href="/background">
<a>Text on background image</a>
</Link>
<Link href="/background">Text on background image</Link>
</li>
</ul>
<hr className={styles.hr} />
......
......@@ -40,29 +40,19 @@ const Index = () => (
</p>
<ul>
<li>
<Link href="/layout-intrinsic">
<a>layout="intrinsic"</a>
</Link>
<Link href="/layout-intrinsic">layout="intrinsic"</Link>
</li>
<li>
<Link href="/layout-responsive">
<a>layout="responsive"</a>
</Link>
<Link href="/layout-responsive">layout="responsive"</Link>
</li>
<li>
<Link href="/layout-fixed">
<a>layout="fixed"</a>
</Link>
<Link href="/layout-fixed">layout="fixed"</Link>
</li>
<li>
<Link href="/layout-fill">
<a>layout="fill"</a>
</Link>
<Link href="/layout-fill">layout="fill"</Link>
</li>
<li>
<Link href="/background">
<a>background demo</a>
</Link>
<Link href="/background">background demo</Link>
</li>
</ul>
<hr className={styles.hr} />
......@@ -81,18 +71,16 @@ const Index = () => (
</p>
<ul>
<li>
<Link href="/placeholder">
<a>placeholder="blur"</a>
</Link>
<Link href="/placeholder">placeholder="blur"</Link>
</li>
<li>
<Link href="/shimmer">
<a>placeholder="blur" with animated shimmer blurDataURL</a>
placeholder="blur" with animated shimmer blurDataURL
</Link>
</li>
<li>
<Link href="/color">
<a>placeholder="blur" with solid color blurDataURL</a>
placeholder="blur" with solid color blurDataURL
</Link>
</li>
</ul>
......
......@@ -5,15 +5,9 @@ export default function Sidebar() {
return (
<nav className={styles.nav}>
<input className={styles.input} placeholder="Search..." />
<Link href="/">
<a>Home</a>
</Link>
<Link href="/about">
<a>About</a>
</Link>
<Link href="/contact">
<a>Contact</a>
</Link>
<Link href="/">Home</Link>
<Link href="/about">About</Link>
<Link href="/contact">Contact</Link>
</nav>
)
}
......@@ -7,17 +7,17 @@ const Home: NextPage = () => {
<h1>Index</h1>
<p>
<Link href="/about" passHref>
<a>Go to about page (will redirect)</a>
Go to about page (will redirect)
</Link>
</p>
<p>
<Link href="/another" passHref>
<a>Go to another page (will rewrite)</a>
Go to another page (will rewrite)
</Link>
</p>
<p>
<Link href="/about2" passHref>
<a>Go to about 2 page (no redirect or rewrite)</a>
Go to about 2 page (no redirect or rewrite)
</Link>
</p>
</div>
......
......@@ -24,18 +24,14 @@ export default function IndexPage() {
</p>
<div className={styles.grid}>
<Link href="/js-form">
<a className={styles.card}>
<h2>Form with JavaScript &rarr;</h2>
<p>Learn to handle forms with JavaScript in Next.js.</p>
</a>
<Link href="/js-form" className={styles.card}>
<h2>Form with JavaScript &rarr;</h2>
<p>Learn to handle forms with JavaScript in Next.js.</p>
</Link>
<Link href="/no-js-form">
<a className={styles.card}>
<h2>Form without JavaScript &rarr;</h2>
<p>Learn to handle forms without JavaScript in Next.js.</p>
</a>
<Link href="/no-js-form" className={styles.card}>
<h2>Form without JavaScript &rarr;</h2>
<p>Learn to handle forms without JavaScript in Next.js.</p>
</Link>
</div>
</main>
......
......@@ -37,11 +37,7 @@ export default function PageWithJSbasedForm() {
return (
<div className="container">
<h1 className={styles.title}>
Form{' '}
<Link href="/">
<a>with</a>
</Link>{' '}
JavaScript.
Form <Link href="/">with</Link> JavaScript.
</h1>
<p className={styles.description}>
......
......@@ -5,11 +5,7 @@ export default function Form() {
return (
<div className="container">
<h1 className={styles.title}>
Form{' '}
<Link href="/">
<a>without</a>
</Link>{' '}
JavaScript.
Form <Link href="/">without</Link> JavaScript.
</h1>
<p className={styles.description}>
Get started by looking at{' '}
......
......@@ -10,7 +10,10 @@ export default function Index() {
<hr className={styles.hr} />
<p>
The links below are{' '}
<Link href="https://nextjs.org/docs/api-reference/next.config.js/redirects">
<Link
href="https://nextjs.org/docs/api-reference/next.config.js/redirects"
legacyBehavior
>
<>
custom <Code>redirects</Code>
</>
......
......@@ -10,7 +10,10 @@ export default function Index() {
<hr className={styles.hr} />
<p>
The links below are{' '}
<Link href="https://nextjs.org/docs/api-reference/next.config.js/rewrites">
<Link
href="https://nextjs.org/docs/api-reference/next.config.js/rewrites"
legacyBehavior
>
<>
custom <Code>rewrites</Code>
</>
......
......@@ -6,19 +6,13 @@ export default function IndexPage() {
Hello World.{' '}
<ul>
<li>
<Link href="/about">
<a>About</a>
</Link>
<Link href="/about">About</Link>
</li>
<li>
<Link href="/ssr">
<a>SSR</a>
</Link>
<Link href="/ssr">SSR</Link>
</li>
<li>
<Link href="/ssg">
<a>SSG</a>
</Link>
<Link href="/ssg">SSG</Link>
</li>
</ul>
</div>
......
......@@ -29,10 +29,8 @@ export default function Home() {
return (
<div style={content}>
<div className="text-center mb-5">
<Link href="#">
<a className="logo mr-0">
<SmileFilled style={{ fontSize: 48 }} />
</a>
<Link href="#" className="logo mr-0">
<SmileFilled style={{ fontSize: 48 }} />
</Link>
<p className="mb-0 mt-3 text-disabled">Welcome to the world !</p>
......
......@@ -6,13 +6,13 @@ export default function Nav() {
return (
<header>
<Link href="/">
<Link href="/" legacyBehavior>
<a className={pathname === '/' ? 'is-active' : ''}>Home</a>
</Link>
<Link href="/apollo">
<Link href="/apollo" legacyBehavior>
<a className={pathname === '/apollo' ? 'is-active' : ''}>Apollo</a>
</Link>
<Link href="/redux">
<Link href="/redux" legacyBehavior>
<a className={pathname === '/redux' ? 'is-active' : ''}>Redux</a>
</Link>
<style jsx>{`
......
......@@ -54,6 +54,7 @@ export default function Actor() {
as={{
pathname: `/movie/${encodeURIComponent(movie.title)}`,
}}
legacyBehavior
>
<a>{movie.title}</a>
</Link>
......@@ -63,7 +64,7 @@ export default function Actor() {
</div>
<div className="back">
<Link href="/">
<Link href="/" legacyBehavior>
<a>🔙 Go Back</a>
</Link>
</div>
......
......@@ -62,6 +62,7 @@ export default function Home() {
as={{
pathname: `/movie/${encodeURIComponent(movie.title)}`,
}}
legacyBehavior
>
<a className="link">{movie.title}</a>
</Link>
......@@ -86,6 +87,7 @@ export default function Home() {
actor.name
)}`,
}}
legacyBehavior
>
<a className="link">{actor.name}</a>
</Link>
......
......@@ -68,7 +68,7 @@ export default function Movie() {
</div>
<div className="back">
<Link href="/">
<Link href="/" legacyBehavior>
<a>🔙 Go Back</a>
</Link>
</div>
......
......@@ -6,18 +6,18 @@ export default function Header() {
return (
<header>
<Link href="/">
<Link href="/" legacyBehavior>
<a className={pathname === '/' ? 'is-active' : ''}>Home</a>
</Link>
<Link href="/about">
<Link href="/about" legacyBehavior>
<a className={pathname === '/about' ? 'is-active' : ''}>About</a>
</Link>
<Link href="/client-only">
<Link href="/client-only" legacyBehavior>
<a className={pathname === '/client-only' ? 'is-active' : ''}>
Client-Only
</a>
</Link>
<Link href="/ssr">
<Link href="/ssr" legacyBehavior>
<a className={pathname === '/ssr' ? 'is-active' : ''}>SSR</a>
</Link>
<style jsx>{`
......
......@@ -25,9 +25,7 @@ export default connect(
<h1>{this.props.title}</h1>
<Clock lastUpdate={this.props.lastUpdate} light={this.props.light} />
<nav>
<Link href={this.props.linkTo}>
<a>Navigate</a>
</Link>
<Link href={this.props.linkTo}>Navigate</Link>
</nav>
</div>
)
......
......@@ -12,11 +12,9 @@ import { SignedIn, SignedOut, UserButton } from '@clerk/nextjs'
const Header = () => (
<header className={styles.header}>
<div className={styles.left}>
<Link href="/">
<a className={styles.logo}>
<Image src="/logo.svg" width="32" height="32" alt="Logo" />
<span className={styles.appName}>Your application</span>
</a>
<Link href="/" className={styles.logo}>
<Image src="/logo.svg" width="32" height="32" alt="Logo" />
<span className={styles.appName}>Your application</span>
</Link>
</div>
<div className={styles.right}>
......
......@@ -44,11 +44,8 @@ const MyApp = ({ Component, pageProps }) => {
<SignedOut>
<main>
<p>
Please{' '}
<Link href="/sign-in">
<a>sign in</a>
</Link>{' '}
to access this page.
Please <Link href="/sign-in">sign in</Link> to access this
page.
</p>
</main>
</SignedOut>
......
......@@ -5,38 +5,34 @@ import styles from '../styles/Home.module.css'
import { SignedIn, SignedOut } from '@clerk/nextjs'
const ClerkFeatures = () => (
<Link href="/user">
<a className={styles.cardContent}>
<img src="/icons/layout.svg" />
<div>
<h3>Explore features provided by Clerk</h3>
<p>
Interact with the user button, user profile, and more to preview what
your users will see
</p>
</div>
<div className={styles.arrow}>
<img src="/icons/arrow-right.svg" />
</div>
</a>
<Link href="/user" className={styles.cardContent}>
<img src="/icons/layout.svg" />
<div>
<h3>Explore features provided by Clerk</h3>
<p>
Interact with the user button, user profile, and more to preview what
your users will see
</p>
</div>
<div className={styles.arrow}>
<img src="/icons/arrow-right.svg" />
</div>
</Link>
)
const SignupLink = () => (
<Link href="/sign-up">
<a className={styles.cardContent}>
<img src="/icons/user-plus.svg" />
<div>
<h3>Sign up for an account</h3>
<p>
Sign up and sign in to explore all the features provided by Clerk
out-of-the-box
</p>
</div>
<div className={styles.arrow}>
<img src="/icons/arrow-right.svg" />
</div>
</a>
<Link href="/sign-up" className={styles.cardContent}>
<img src="/icons/user-plus.svg" />
<div>
<h3>Sign up for an account</h3>
<p>
Sign up and sign in to explore all the features provided by Clerk
out-of-the-box
</p>
</div>
<div className={styles.arrow}>
<img src="/icons/arrow-right.svg" />
</div>
</Link>
)
......@@ -72,20 +68,23 @@ const Main = () => (
</div>
<div className={styles.card}>
<Link href="https://dashboard.clerk.dev">
<a target="_blank" rel="noreferrer" className={styles.cardContent}>
<img src="/icons/settings.svg" />
<div>
<h3>Configure settings for your app</h3>
<p>
Visit Clerk to manage instances and configure settings for user
management, theme, and more
</p>
</div>
<div className={styles.arrow}>
<img src="/icons/arrow-right.svg" />
</div>
</a>
<Link
href="https://dashboard.clerk.dev"
target="_blank"
rel="noreferrer"
className={styles.cardContent}
>
<img src="/icons/settings.svg" />
<div>
<h3>Configure settings for your app</h3>
<p>
Visit Clerk to manage instances and configure settings for user
management, theme, and more
</p>
</div>
<div className={styles.arrow}>
<img src="/icons/arrow-right.svg" />
</div>
</Link>
</div>
</div>
......@@ -93,15 +92,21 @@ const Main = () => (
<APIRequest />
<div className={styles.links}>
<Link href="https://docs.clerk.dev">
<a target="_blank" rel="noreferrer" className={styles.link}>
<span className={styles.linkText}>Read Clerk documentation</span>
</a>
<Link
href="https://docs.clerk.dev"
target="_blank"
rel="noreferrer"
className={styles.link}
>
<span className={styles.linkText}>Read Clerk documentation</span>
</Link>
<Link href="https://nextjs.org/docs">
<a target="_blank" rel="noreferrer" className={styles.link}>
<span className={styles.linkText}>Read NextJS documentation</span>
</a>
<Link
href="https://nextjs.org/docs"
target="_blank"
rel="noreferrer"
className={styles.link}
>
<span className={styles.linkText}>Read NextJS documentation</span>
</Link>
</div>
</main>
......
......@@ -16,9 +16,7 @@ export default function Home({ posts }) {
<ul className={utilStyles.list}>
{posts.map(({ slug, date, title }) => (
<li className={utilStyles.listItem} key={slug}>
<Link href={`/posts/${slug}`}>
<a>{title}</a>
</Link>
<Link href={`/posts/${slug}`}>{title}</Link>
<br />
<small className={utilStyles.lightText}>{date}</small>
</li>
......
......@@ -23,9 +23,7 @@ const AboutPage = () => {
<button onClick={handleIncrease}>Increase</button>
<button onClick={handleIncrease15}>Increase By 15</button>
<p>
<Link href="/">
<a>Home</a>
</Link>
<Link href="/">Home</Link>
</p>
</>
)
......
......@@ -22,9 +22,7 @@ const IndexPage = () => {
<button onClick={handleIncrease}>Increase</button>
<button onClick={handleDecrease}>Decrease</button>
<p>
<Link href="/about">
<a>About</a>
</Link>
<Link href="/about">About</Link>
</p>
</>
)
......
......@@ -6,22 +6,22 @@ const Header = (props) => (
<nav>
<ul>
<li>
<Link href="/">
<Link href="/" legacyBehavior>
<a>Home</a>
</Link>
</li>
<li>
<Link href="/login">
<Link href="/login" legacyBehavior>
<a>Login</a>
</Link>
</li>
<li>
<Link href="/signup">
<Link href="/signup" legacyBehavior>
<a>Signup</a>
</Link>
</li>
<li>
<Link href="/profile">
<Link href="/profile" legacyBehavior>
<a>Profile</a>
</Link>
</li>
......
......@@ -7,9 +7,7 @@ export default function About() {
<main className={styles.main}>
<h1>About Page</h1>
<p className={styles.description}>
<Link href="/">
<a>&larr; Go Back</a>
</Link>
<Link href="/">&larr; Go Back</Link>
</p>
</main>
</div>
......
......@@ -23,11 +23,9 @@ export default function Home() {
</p>
<div className={styles.grid}>
<Link href="/about">
<a className={styles.card}>
<h2>About Page &rarr;</h2>
<p>Cypress will test if this link is working.</p>
</a>
<Link href="/about" className={styles.card}>
<h2>About Page &rarr;</h2>
<p>Cypress will test if this link is working.</p>
</Link>
<a href="https://nextjs.org/docs" className={styles.card}>
......
......@@ -3,12 +3,12 @@ import Link from 'next/link'
export default function Header() {
return (
<div>
<Link href="/">
<a style={{ marginRight: 10 }}>Home</a>
<Link href="/" style={{ marginRight: 10 }}>
Home
</Link>
<Link href="/about">
<a style={{ marginRight: 10 }}>About</a>
<Link href="/about" style={{ marginRight: 10 }}>
About
</Link>
</div>
)
......
......@@ -5,15 +5,15 @@ const Header: React.FC = () => {
return (
<nav>
<div className="left">
<Link href="/">
<Link href="/" legacyBehavior>
<a>Blog</a>
</Link>
<Link href="/drafts">
<Link href="/drafts" legacyBehavior>
<a>Drafts</a>
</Link>
</div>
<div className="right">
<Link href="/create">
<Link href="/create" legacyBehavior>
<a>+ New draft</a>
</Link>
</div>
......
......@@ -5,7 +5,7 @@ import { PostProps } from '../pages/blog/[id]'
const Post: React.FC<{ post: PostProps }> = ({ post }) => {
return (
<Link href={`/blog/${post.id}`} passHref>
<Link href={`/blog/${post.id}`} passHref legacyBehavior>
<div>
<h2>{post.title}</h2>
<small>By {post.authorName}</small>
......
......@@ -54,7 +54,7 @@ const Draft: React.FC = () => {
type="submit"
value="Create"
/>
<Link href="/">
<Link href="/" legacyBehavior>
<a className="back">Cancel</a>
</Link>
</form>
......
......@@ -16,17 +16,8 @@ const Layout = ({ children, title = 'This is the default title' }: Props) => (
</Head>
<header>
<nav>
<Link href="/">
<a>Home</a>
</Link>{' '}
|{' '}
<Link href="/about">
<a>About</a>
</Link>{' '}
|{' '}
<Link href="/initial-props">
<a>With Initial Props</a>
</Link>
<Link href="/">Home</Link> | <Link href="/about">About</Link> |{' '}
<Link href="/initial-props">With Initial Props</Link>
</nav>
</header>
{children}
......
......@@ -9,9 +9,7 @@ type Props = {
const ListItem = ({ data }: Props) => (
<Link href="/detail/[id]" as={`/detail/${data.id}`}>
<a>
{data.id}: {data.name}
</a>
{data.id}:{data.name}
</Link>
)
......
......@@ -6,9 +6,7 @@ const AboutPage = () => (
<h1>About</h1>
<p>This is the about page</p>
<p>
<Link href="/">
<a>Go home</a>
</Link>
<Link href="/">Go home</Link>
</p>
</Layout>
)
......
......@@ -23,9 +23,7 @@ const IndexPage = () => {
<h1>Hello Next.js 👋</h1>
<button onClick={onSayHiClick}>Say hi to electron</button>
<p>
<Link href="/about">
<a>About</a>
</Link>
<Link href="/about">About</Link>
</p>
</Layout>
)
......
......@@ -18,9 +18,7 @@ const WithInitialProps = ({ items }: Props) => {
<p>You are currently on: {router.pathname}</p>
<List items={items} />
<p>
<Link href="/">
<a>Go home</a>
</Link>
<Link href="/">Go home</Link>
</p>
</Layout>
)
......
......@@ -18,9 +18,7 @@ export default function Home() {
<p>
Click the link below to navigate to another page.
<br />
<Link href="/navigation">
<a>Navigation page</a>
</Link>
<Link href="/navigation">Navigation page</Link>
</p>
</div>
)
......
......@@ -7,9 +7,7 @@ export default function NavigationPage() {
Navigating between pages will trigger a pageview event in Facebook
Pixel, but will not reinitialize the pixel.
</p>
<Link href="/">
<a>Return to home</a>
</Link>
<Link href="/">Return to home</Link>
</div>
)
}
......@@ -20,8 +20,9 @@ const CustomLink: React.FC<PropsWithChildren<{ to: string }>> = ({
query: { cacheStrategy },
}}
scroll={false}
className={className}
>
<a className={className}>{children}</a>
{children}
</Link>
</div>
)
......
......@@ -3,11 +3,11 @@ import Link from 'next/link'
const Header = ({ pathname }) => (
<header>
<Link href="/">
<a className={pathname === '/' ? 'is-active' : ''}>Home</a>
<Link href="/" className={pathname === '/' ? 'is-active' : ''}>
Home
</Link>{' '}
<Link href="/about">
<a className={pathname === '/about' ? 'is-active' : ''}>About</a>
<Link href="/about" className={pathname === '/about' ? 'is-active' : ''}>
About
</Link>
</header>
)
......
......@@ -45,7 +45,7 @@ export default function Home() {
<p className="description">
Please press the link below after adding the user
</p>
<Link href={`/profile/${profile.username}`} passHref>
<Link href={`/profile/${profile.username}`} passHref legacyBehavior>
<a>Go to SSR Page</a>
</Link>
</main>
......
......@@ -5,17 +5,8 @@ function MyApp({ Component, pageProps }) {
<>
<header>
<nav>
<Link href="/">
<a>Home</a>
</Link>
|
<Link href="/about">
<a>About</a>
</Link>
|
<Link href="/contact">
<a>Contact</a>
</Link>
<Link href="/">Home</Link>|<Link href="/about">About</Link>|
<Link href="/contact">Contact</Link>
</nav>
</header>
......
......@@ -33,7 +33,12 @@ const Thumbnail = ({ id, i }) => (
variants={frameVariants}
transition={transition}
>
<Link href="/image/[index]" as={`/image/${i}`} scroll={false}>
<Link
href="/image/[index]"
as={`/image/${i}`}
scroll={false}
legacyBehavior
>
<motion.img
src={`https://images.unsplash.com/${id}?auto=format&fit=crop&w=1500`}
alt="The Barbican"
......
......@@ -32,9 +32,7 @@ const SingleImage = ({ index }) => (
alt="The Barbican"
/>
<motion.div className="back" variants={backVariants}>
<Link href="/">
<a>← Back</a>
</Link>
<Link href="/">← Back</Link>
</motion.div>
</motion.div>
<style>
......
......@@ -6,19 +6,13 @@ export default function Header() {
<nav>
<ul>
<li>
<Link href="/">
<a>Home</a>
</Link>
<Link href="/">Home</Link>
</li>
<li>
<Link href="/about">
<a>About</a>
</Link>
<Link href="/about">About</Link>
</li>
<li>
<Link href="/contact">
<a>Contact</a>
</Link>
<Link href="/contact">Contact</Link>
</li>
</ul>
</nav>
......
......@@ -6,19 +6,13 @@ export default function Header() {
<nav>
<ul>
<li>
<Link href="/">
<a>Home</a>
</Link>
<Link href="/">Home</Link>
</li>
<li>
<Link href="/about">
<a>About</a>
</Link>
<Link href="/about">About</Link>
</li>
<li>
<Link href="/contact">
<a>Contact</a>
</Link>
<Link href="/contact">Contact</Link>
</li>
</ul>
</nav>
......
......@@ -6,10 +6,10 @@ export default function Header() {
return (
<header>
<Link href="/">
<Link href="/" legacyBehavior>
<a className={pathname === '/' ? 'is-active' : ''}>Home</a>
</Link>
<Link href="/about">
<Link href="/about" legacyBehavior>
<a className={pathname === '/about' ? 'is-active' : ''}>About</a>
</Link>
<style jsx>{`
......
......@@ -3,9 +3,7 @@ export default function About() {
return (
<div>
<h3>This is the /about page. </h3>
<Link href="/">
<a> &larr; Back home</a>
</Link>
<Link href="/">&larr; Back home</Link>
</div>
)
}
......@@ -3,9 +3,7 @@ export default function Home() {
return (
<div>
<h3>Hello World.</h3>
<Link href="/about">
<a>About</a>
</Link>
<Link href="/about">About</Link>
</div>
)
}
......@@ -10,16 +10,12 @@ export default function Navigation() {
return (
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', gap: 10 }}>
<Link href="/">
<a>{t('index')}</a>
</Link>
<Link href="/about">
<a>{t('about')}</a>
</Link>
<Link href="/">{t('index')}</Link>
<Link href="/about">{t('about')}</Link>
</div>
{otherLocale && (
<Link href={route} locale={otherLocale}>
<a>{t('switchLocale', { locale: otherLocale })}</a>
{t('switchLocale', { locale: otherLocale })}
</Link>
)}
</div>
......
......@@ -20,7 +20,7 @@ const HomePage = () => {
<h3>{i18n.t('intro.description')}</h3>
<div>Current locale: {i18n.activeLocale}</div>
<Link href="/[lng]" as="/de">
<a>Use client-side routing to change language to 'de'</a>
Use client-side routing to change language to 'de'
</Link>
</div>
)
......
......@@ -13,13 +13,13 @@ export default function Header() {
<nav>
<ul>
<li>
<Link href="/">
<Link href="/" legacyBehavior>
<a>Home</a>
</Link>
</li>
{user?.isLoggedIn === false && (
<li>
<Link href="/login">
<Link href="/login" legacyBehavior>
<a>Login</a>
</Link>
</li>
......@@ -27,7 +27,7 @@ export default function Header() {
{user?.isLoggedIn === true && (
<>
<li>
<Link href="/profile-sg">
<Link href="/profile-sg" legacyBehavior>
<a>
<span
style={{
......@@ -49,7 +49,7 @@ export default function Header() {
</Link>
</li>
<li>
<Link href="/profile-ssr">
<Link href="/profile-ssr" legacyBehavior>
<a>Profile (Server-side Rendering)</a>
</Link>
</li>
......
......@@ -12,10 +12,12 @@ export default function LangSwitcher() {
const otherLocale = locales?.find((cur) => cur !== locale)
return (
<Link href={route} locale={otherLocale}>
<a style={{ display: 'block', marginBottom: '20px' }}>
{availableLanguageNames[otherLocale]}
</a>
<Link
href={route}
locale={otherLocale}
style={{ display: 'block', marginBottom: '20px' }}
>
{availableLanguageNames[otherLocale]}
</Link>
)
}
......@@ -5,9 +5,7 @@ const Index = () => (
<div>
<Trans>Hello World.</Trans>
<Link href="/two">
<a>
<Trans>Go to page 2</Trans>
</a>
<Trans>Go to page 2</Trans>
</Link>
<br />
</div>
......
......@@ -5,9 +5,7 @@ const Two = () => (
<div>
<Trans>Page two.</Trans>{' '}
<Link href="/">
<a>
<Trans>Back home</Trans>
</a>
<Trans>Back home</Trans>
</Link>
<br />
</div>
......
......@@ -37,13 +37,13 @@ export default function App({ Component, pageProps }: AppProps) {
margin: 0 10px 0 0;
}
`}</style>
<Link href="/">
<Link href="/" legacyBehavior>
<a>Home</a>
</Link>
<Link href="/about">
<Link href="/about" legacyBehavior>
<a>About</a>
</Link>
<Link href="/forever">
<Link href="/forever" legacyBehavior>
<a>Forever</a>
</Link>
<a href="/non-existing">Non Existing Page</a>
......
......@@ -9,14 +9,14 @@ const Header = () => {
<nav>
<ul>
<li>
<Link href="/">
<Link href="/" legacyBehavior>
<a>Home</a>
</Link>
</li>
{user ? (
<>
<li>
<Link href="/profile">
<Link href="/profile" legacyBehavior>
<a>Profile</a>
</Link>
</li>
......@@ -26,7 +26,7 @@ const Header = () => {
</>
) : (
<li>
<Link href="/login">
<Link href="/login" legacyBehavior>
<a>Login</a>
</Link>
</li>
......
......@@ -3,7 +3,7 @@ import Link from 'next/link'
export default function CustomLink({ as, href, ...otherProps }) {
return (
<>
<Link as={as} href={href}>
<Link as={as} href={href} legacyBehavior>
<a {...otherProps} />
</Link>
<style jsx>{`
......
......@@ -20,7 +20,7 @@ export default function Index({ posts }) {
as={`/posts/${post.filePath.replace(/\.mdx?$/, '')}`}
href={`/posts/[slug]`}
>
<a>{post.data.title}</a>
{post.data.title}
</Link>
</li>
))}
......
......@@ -28,7 +28,7 @@ export default function PostPage({ source, frontMatter }) {
<Layout>
<header>
<nav>
<Link href="/">
<Link href="/" legacyBehavior>
<a>👈 Go back home</a>
</Link>
</nav>
......
......@@ -25,9 +25,7 @@ const SampleComponent: React.FC<IOwnProps> = observer((props) => {
<h1>{props.title}</h1>
<Clock lastUpdate={lastUpdate} light={light} />
<nav>
<Link href={props.linkTo}>
<a>Navigate</a>
</Link>
<Link href={props.linkTo}>Navigate</Link>
</nav>
</div>
)
......
......@@ -23,9 +23,7 @@ const Page = observer(function Page(props) {
<h1>{props.title}</h1>
<Clock />
<nav>
<Link href={props.linkTo}>
<a>Navigate</a>
</Link>
<Link href={props.linkTo}>Navigate</Link>
</nav>
</div>
)
......
......@@ -49,7 +49,7 @@ const PetPage = ({ pet }) => {
</div>
<div className="btn-container">
<Link href="/[id]/edit" as={`/${pet._id}/edit`}>
<Link href="/[id]/edit" as={`/${pet._id}/edit`} legacyBehavior>
<button className="btn edit">Edit</button>
</Link>
<button className="btn delete" onClick={handleDelete}>
......
......@@ -12,12 +12,8 @@ function MyApp({ Component, pageProps }) {
<div className="top-bar">
<div className="nav">
<Link href="/">
<a>Home</a>
</Link>
<Link href="/new">
<a>Add Pet</a>
</Link>
<Link href="/">Home</Link>
<Link href="/new">Add Pet</Link>
</div>
<img
......
......@@ -33,10 +33,10 @@ const Index = ({ pets }) => (
</div>
<div className="btn-container">
<Link href="/[id]/edit" as={`/${pet._id}/edit`}>
<Link href="/[id]/edit" as={`/${pet._id}/edit`} legacyBehavior>
<button className="btn edit">Edit</button>
</Link>
<Link href="/[id]" as={`/${pet._id}`}>
<Link href="/[id]" as={`/${pet._id}`} legacyBehavior>
<button className="btn view">View</button>
</Link>
</div>
......
......@@ -48,11 +48,7 @@ export default function Asset() {
<>
<ErrorMessage message={errorMessage} />
<p>
Go{' '}
<Link href="/">
<a>back home</a>
</Link>{' '}
to upload another video.
Go <Link href="/">back home</Link> to upload another video.
</p>
</>
) : (
......
......@@ -53,7 +53,7 @@ export default function Playback({ playbackId, poster }) {
<MuxPlayer style={{ width: '100%' }} playbackId={playbackId} />
<p>
Go{' '}
<Link href="/">
<Link href="/" legacyBehavior>
<a>back home</a>
</Link>{' '}
to upload another video.
......
......@@ -41,6 +41,7 @@ export default function Actor() {
as={{
pathname: `/movie/${encodeURIComponent(movie)}`,
}}
legacyBehavior
>
<a>{movie}</a>
</Link>
......@@ -50,7 +51,7 @@ export default function Actor() {
</div>
<div className="back">
<Link href="/">
<Link href="/" legacyBehavior>
<a>🔙 Go Back</a>
</Link>
</div>
......
......@@ -42,7 +42,10 @@ export default function Home() {
<tr className="movie" key={movie.title}>
<th>{index + 1}</th>
<td>
<Link href={`/movie/${encodeURIComponent(movie.title)}`}>
<Link
href={`/movie/${encodeURIComponent(movie.title)}`}
legacyBehavior
>
<a className="link">{movie.title}</a>
</Link>
</td>
......@@ -59,7 +62,10 @@ export default function Home() {
<ul>
{movie.actors.map((actor) => (
<li key={actor}>
<Link href={`/actor/${encodeURIComponent(actor)}`}>
<Link
href={`/actor/${encodeURIComponent(actor)}`}
legacyBehavior
>
<a className="link">{actor}</a>
</Link>
</li>
......
......@@ -40,7 +40,11 @@ export default function Movie() {
<h2>Actors</h2>
{data.movie.actors.map((actor) => (
<div key={actor}>
<Link key={actor} href={`/actor/${encodeURIComponent(actor)}`}>
<Link
key={actor}
href={`/actor/${encodeURIComponent(actor)}`}
legacyBehavior
>
<a className="link">{actor}</a>
</Link>
</div>
......@@ -55,7 +59,7 @@ export default function Movie() {
</div>
<div className="back">
<Link href="/">
<Link href="/" legacyBehavior>
<a>🔙 Go Back</a>
</Link>
</div>
......
......@@ -3,13 +3,13 @@ import Link from 'next/link'
const Layout = ({ children }) => (
<>
<nav>
<Link href="/">
<Link href="/" legacyBehavior>
<a>home</a>
</Link>
<Link href="/blog">
<Link href="/blog" legacyBehavior>
<a>blog</a>
</Link>
<Link href="/about">
<Link href="/about" legacyBehavior>
<a>about</a>
</Link>
</nav>
......
......@@ -20,7 +20,11 @@ const Blog = ({ postsList }) => (
<Layout>
{postsList.map((post) => (
<div key={post.slug} className="post">
<Link href="/blog/post/[slug]" as={`/blog/post/${post.slug}`}>
<Link
href="/blog/post/[slug]"
as={`/blog/post/${post.slug}`}
legacyBehavior
>
<a>
<img src={post.attributes.thumbnail} />
<h2>{post.attributes.title}</h2>
......
......@@ -25,8 +25,8 @@ const About = (props) => {
Notice how a loading spinner showed up while my content was "loading"?
Pretty neat, huh?
</p>
<Link href="/">
<a className="btn btn-light">Go back home</a>
<Link href="/" className="btn btn-light">
Go back home
</Link>
</div>
)
......
......@@ -3,8 +3,8 @@ import Link from 'next/link'
const Index = () => (
<div className="container bg-primary page">
<h1>Hello, world!</h1>
<Link href="/about">
<a className="btn btn-light">About us</a>
<Link href="/about" className="btn btn-light">
About us
</Link>
</div>
)
......
......@@ -33,11 +33,8 @@ export default function Home() {
<h1>SEO Added to Page</h1>
<p>Take a look at the head to see what has been added.</p>
<p>
Or checkout how{' '}
<Link href="/jsonld">
<a>JSON-LD</a>
</Link>{' '}
(Structured Data) is added
Or checkout how <Link href="/jsonld">JSON-LD</Link> (Structured Data) is
added
</p>
</div>
)
......
......@@ -6,27 +6,27 @@ const IndexPage = () => (
<ol>
<li>
<Link href="/[dynamic]" as="/page-1">
<a>Link to dynamic page 1</a>
Link to dynamic page 1
</Link>
</li>
<li>
<Link href="/[dynamic]" as="/page-2">
<a>Link to dynamic page 2</a>
Link to dynamic page 2
</Link>
</li>
<li>
<Link href="/[dynamic]" as="/page-3">
<a>Link to dynamic page 3</a>
Link to dynamic page 3
</Link>
</li>
<li>
<Link href="/[dynamic]" as="/page-4">
<a>Link to dynamic page 4</a>
Link to dynamic page 4
</Link>
</li>
<li>
<Link href="/[dynamic]" as="/page-5">
<a>Link to dynamic page 5</a>
Link to dynamic page 5
</Link>
</li>
</ol>
......
......@@ -24,7 +24,7 @@ export default function Home() {
</p>
<div className="grid">
<Link href="/" locale="en">
<Link href="/" locale="en" legacyBehavior>
<div className="card">
<h3>{t('home:english')}</h3>
<p>
......@@ -33,7 +33,7 @@ export default function Home() {
</div>
</Link>
<Link href="/" locale="ca">
<Link href="/" locale="ca" legacyBehavior>
<div className="card">
<h3>{t('home:catalan')}</h3>
<p>
......@@ -42,7 +42,7 @@ export default function Home() {
</div>
</Link>
<Link href="/" locale="ar">
<Link href="/" locale="ar" legacyBehavior>
<div className="card">
<h3>{t('home:arabic')}</h3>
<p>
......@@ -51,7 +51,7 @@ export default function Home() {
</div>
</Link>
<Link href="/" locale="he">
<Link href="/" locale="he" legacyBehavior>
<div className="card">
<h3>{t('home:hebrew')}</h3>
<p>
......
......@@ -8,12 +8,8 @@ function Header() {
return (
<div>
<h1>{state.page}</h1>
<Link href="/">
<a>Home page</a>
</Link>
<Link href="/about">
<a>About Page</a>
</Link>
<Link href="/">Home page</Link>
<Link href="/about">About Page</Link>
</div>
)
}
......
......@@ -14,12 +14,16 @@ export default function Navbar() {
<nav>
<ul>
<li>
<Link href="/">Home</Link>
<Link href="/" legacyBehavior>
Home
</Link>
</li>
{user ? (
<>
<li>
<Link href="/profile">Profile</Link>
<Link href="/profile" legacyBehavior>
Profile
</Link>
</li>
<li>
<a role="button" onClick={handleLogout}>
......@@ -30,10 +34,14 @@ export default function Navbar() {
) : (
<>
<li>
<Link href="/signup">Sign up</Link>
<Link href="/signup" legacyBehavior>
Sign up
</Link>
</li>
<li>
<Link href="/login">Login</Link>
<Link href="/login" legacyBehavior>
Login
</Link>
</li>
</>
)}
......
......@@ -20,14 +20,14 @@ const Form = ({ isLogin, errorMessage, onSubmit }) => (
<div className="submit">
{isLogin ? (
<>
<Link href="/signup">
<Link href="/signup" legacyBehavior>
<a>I don't have an account</a>
</Link>
<button type="submit">Login</button>
</>
) : (
<>
<Link href="/login">
<Link href="/login" legacyBehavior>
<a>I already have an account</a>
</Link>
<button type="submit">Signup</button>
......
......@@ -9,14 +9,14 @@ const Header = () => {
<nav>
<ul>
<li>
<Link href="/">
<Link href="/" legacyBehavior>
<a>Home</a>
</Link>
</li>
{user ? (
<>
<li>
<Link href="/profile">
<Link href="/profile" legacyBehavior>
<a>Profile</a>
</Link>
</li>
......@@ -26,7 +26,7 @@ const Header = () => {
</>
) : (
<li>
<Link href="/login">
<Link href="/login" legacyBehavior>
<a>Login</a>
</Link>
</li>
......
......@@ -6,19 +6,13 @@ export default function Header() {
<nav>
<ul>
<li>
<Link href="/">
<a>Home</a>
</Link>
<Link href="/">Home</Link>
</li>
<li>
<Link href="/about">
<a>About</a>
</Link>
<Link href="/about">About</Link>
</li>
<li>
<Link href="/contact">
<a>Contact</a>
</Link>
<Link href="/contact">Contact</Link>
</li>
</ul>
</nav>
......
......@@ -7,9 +7,7 @@ export default function About() {
<main className={styles.main}>
<h1>About Page</h1>
<p className={styles.description}>
<Link href="/">
<a>&larr; Go Back</a>
</Link>
<Link href="/">&larr; Go Back</Link>
</p>
</main>
</div>
......
......@@ -23,11 +23,9 @@ export default function Home() {
</p>
<div className={styles.grid}>
<Link href="/about">
<a className={styles.card}>
<h2>About Page &rarr;</h2>
<p>Playwright will test if this link is working.</p>
</a>
<Link href="/about" className={styles.card}>
<h2>About Page &rarr;</h2>
<p>Playwright will test if this link is working.</p>
</Link>
<a href="https://nextjs.org/docs" className={styles.card}>
......
......@@ -10,15 +10,15 @@ export default function Nav() {
Automatically prefetch pages in the background as soon the Link appears
in the view:
</p>
<Link href="/">
<Link href="/" legacyBehavior>
<a>Home</a>
</Link>{' '}
<Link href="/features">
<Link href="/features" legacyBehavior>
<a>Features</a>
</Link>
<h2>Imperative</h2>
<p>Prefetch on onMouseEnter or on other events:</p>
<Link prefetch={false} href="/about">
<Link prefetch={false} href="/about" legacyBehavior>
<a
onMouseEnter={() => {
router.prefetch('/about')
......@@ -30,7 +30,7 @@ export default function Nav() {
</Link>
<h2>Disable</h2>
<p>Disable prefetching</p>
<Link prefetch={false} href="/contact">
<Link prefetch={false} href="/contact" legacyBehavior>
<a>Contact</a>
</Link>
<style jsx>{`
......
......@@ -20,13 +20,13 @@ const Layout = ({ children }) => {
</Navbar.Brand>
<Navbar.Menu>
<Navbar.Segment align="start">
<Link href="/">
<Link href="/" legacyBehavior>
<Navbar.Item>Home</Navbar.Item>
</Link>
<Link href="/about">
<Link href="/about" legacyBehavior>
<Navbar.Item>About</Navbar.Item>
</Link>
<Link href="/contact">
<Link href="/contact" legacyBehavior>
<Navbar.Item>Contact</Navbar.Item>
</Link>
</Navbar.Segment>
......
......@@ -9,10 +9,8 @@ const Home = () => (
<Card.Content>
<Content>
<Link href="https://github.com/vercel/next.js#getting-started">
<a>
<Title as="h3">Getting Started &rarr;</Title>
<p>Learn more about Next on Github and in their examples</p>
</a>
<Title as="h3">Getting Started &rarr;</Title>
<p>Learn more about Next on Github and in their examples</p>
</Link>
</Content>
</Card.Content>
......@@ -21,13 +19,11 @@ const Home = () => (
<Card.Content>
<Content>
<Link href="https://github.com/vercel/next.js/tree/canary/examples">
<a>
<Title as="h3">Examples &rarr;</Title>
<p>
Find other example boilerplates on the{' '}
<code>create-next-app</code> site
</p>
</a>
<Title as="h3">Examples &rarr;</Title>
<p>
Find other example boilerplates on the{' '}
<code>create-next-app</code> site
</p>
</Link>
</Content>
</Card.Content>
......@@ -36,10 +32,8 @@ const Home = () => (
<Card.Content>
<Content>
<Link href="https://github.com/vercel/next.js/tree/canary/packages/create-next-app">
<a>
<Title as="h3">Create Next App &rarr;</Title>
<p>Was this tool helpful? Let us know how we can improve it</p>
</a>
<Title as="h3">Create Next App &rarr;</Title>
<p>Was this tool helpful? Let us know how we can improve it</p>
</Link>
</Content>
</Card.Content>
......
......@@ -16,7 +16,7 @@ export default function Home() {
<code>react-foundation</code>.
</p>
<Link href="https://nextjs.org" passHref={true}>
<a>view repository</a>
view repository
</Link>
</Callout>
</div>
......
......@@ -3,10 +3,7 @@ import Link from 'next/link'
export default function Home() {
return (
<div>
Hello World.{' '}
<Link href="/about">
<a>About</a>
</Link>
Hello World. <Link href="/about">About</Link>
</div>
)
}
......@@ -9,22 +9,18 @@ export default function Nav() {
<nav className={styles.nav}>
<li className={styles.li}>
<Link href="/" passHref>
<a>
<FormattedMessage
defaultMessage="Home"
description="Nav: Index name"
/>
</a>
<FormattedMessage
defaultMessage="Home"
description="Nav: Index name"
/>
</Link>
</li>
<li className={styles.li}>
<Link href="/about" passHref>
<a>
<FormattedMessage
defaultMessage="About"
description="Nav: About item"
/>
</a>
<FormattedMessage
defaultMessage="About"
description="Nav: About item"
/>
</Link>
</li>
......@@ -37,12 +33,9 @@ export default function Nav() {
locale={availableLocale}
passHref
prefetch={false}
className={availableLocale === locale ? styles.active : undefined}
>
<a
className={availableLocale === locale ? styles.active : undefined}
>
{availableLocale}
</a>
{availableLocale}
</Link>
</li>
))}
......
......@@ -30,8 +30,9 @@ export default function LinkUnstyled({
replace={replace}
href={href}
as={as}
{...props}
>
<a {...props}>{children}</a>
{children}
</Link>
)
}
......@@ -26,8 +26,9 @@ export default function LinkUnstyled({
replace={replace}
href={href}
as={as}
{...props}
>
<a {...props}>{children}</a>
{children}
</Link>
)
}
......@@ -20,9 +20,7 @@ const Counter = () => {
<UserInfo />
<br />
<nav>
<Link href="/other">
<a>Navigate to "/other"</a>
</Link>
<Link href="/other">Navigate to "/other"</Link>
</nav>
</div>
)
......
......@@ -3,9 +3,7 @@ import Link from 'next/link'
const OtherPage = () => (
<div>
<h1>Other Page</h1>
<Link href="/">
<a>Get back to "/"</a>
</Link>
<Link href="/">Get back to "/"</Link>
</div>
)
......
......@@ -15,9 +15,7 @@ function Page({ linkTo, NavigateTo, title }) {
<Clock lastUpdate={lastUpdate} light={light} />
<Counter />
<nav>
<Link href={linkTo}>
<a>Navigate: {NavigateTo}</a>
</Link>
<Link href={linkTo}>Navigate:{NavigateTo}</Link>
</nav>
{placeholderData && (
<pre>
......
......@@ -13,9 +13,7 @@ const Index = () => {
return (
<>
<Examples />
<Link href="/show-redux-state">
<a>Click to see current Redux State</a>
</Link>
<Link href="/show-redux-state">Click to see current Redux State</Link>
</>
)
}
......
......@@ -17,9 +17,7 @@ const ShowReduxState = () => {
<pre style={codeStyle}>
<code>{JSON.stringify(state, null, 4)}</code>
</pre>
<Link href="/">
<a>Go Back Home</a>
</Link>
<Link href="/">Go Back Home</Link>
</>
)
}
......
......@@ -9,9 +9,7 @@ const Page = ({ title, linkTo, tick }) => (
<Clock lastUpdate={tick.lastUpdate} light={tick.light} />
<AddCount />
<nav>
<Link href={linkTo}>
<a>Navigate</a>
</Link>
<Link href={linkTo}>Navigate</Link>
</nav>
</div>
)
......
......@@ -3,9 +3,7 @@ import Link from 'next/link'
export default function About() {
return (
<div>
<Link href="/">
<a>Home</a>
</Link>
<Link href="/">Home</Link>
<p>This is the about page</p>
</div>
)
......
......@@ -6,9 +6,7 @@ import indexPageQuery from '../queries/indexPage'
const Index = ({ viewer }) => (
<div>
<Link href="/about">
<a>About</a>
</Link>
<Link href="/about">About</Link>
<BlogPosts viewer={viewer} />
</div>
)
......
......@@ -9,8 +9,13 @@ export default function PostCardGrid() {
<h2>With QueryString Routing, and a reload won't use the modal</h2>
<div className={styles.postCardGrid}>
{data.map((id, index) => (
<Link key={index} href={`/?postId=${id}`} as={`/post/${id}`}>
<a className={styles.postCard}>{id}</a>
<Link
key={index}
href={`/?postId=${id}`}
as={`/post/${id}`}
className={styles.postCard}
>
{id}
</Link>
))}
</div>
......@@ -18,8 +23,13 @@ export default function PostCardGrid() {
<h2>With Dynamic Routing, and reloads will keep the modal</h2>
<div className={styles.postCardGrid}>
{data.map((id, index) => (
<Link key={index} href="/article/[articleId]" as={`/article/${id}`}>
<a className={styles.postCard}>{id}</a>
<Link
key={index}
href="/article/[articleId]"
as={`/article/${id}`}
className={styles.postCard}
>
{id}
</Link>
))}
</div>
......
......@@ -7,19 +7,13 @@ export default function Header() {
<nav>
<ul>
<li>
<Link href="/">
<a>Home</a>
</Link>
<Link href="/">Home</Link>
</li>
<li>
<Link href="/about">
<a>About</a>
</Link>
<Link href="/about">About</Link>
</li>
<li>
<Link href="/contact">
<a>Contact</a>
</Link>
<Link href="/contact">Contact</Link>
</li>
</ul>
</nav>
......
......@@ -82,10 +82,7 @@ const Index = () => (
<a href="/ssr/test1" target="_blank">
Open in a new tab
</a>{' '}
or{' '}
<Link href="/ssr/test1">
<a>Perform client side navigation</a>
</Link>
or <Link href="/ssr/test1">Perform client side navigation</Link>
</li>
<li>
getServerSideProps returns a Promise that rejects. This should cause
......@@ -117,10 +114,7 @@ const Index = () => (
<li>
There is a top-of-module Promise that rejects, but its result is not
awaited. Sentry should record Error('Client Test 1').{' '}
<Link href="/client/test1">
<a>Perform client side navigation</a>
</Link>{' '}
or{' '}
<Link href="/client/test1">Perform client side navigation</Link> or{' '}
<a href="/client/test1" target="_blank">
Open in a new tab
</a>
......@@ -128,10 +122,7 @@ const Index = () => (
<li>
There is a top-of-module exception. _error.js should render and record
ReferenceError('process is not defined') in Sentry.{' '}
<Link href="/client/test2">
<a>Perform client side navigation</a>
</Link>{' '}
or{' '}
<Link href="/client/test2">Perform client side navigation</Link> or{' '}
<a href="/client/test2" target="_blank">
Open in a new tab
</a>
......@@ -141,10 +132,7 @@ const Index = () => (
Next.js's React Error Boundary. In this case, when the component
mounts. This should cause _error.js to render and record Error('Client
Test 3') in Sentry.{' '}
<Link href="/client/test3">
<a>Perform client side navigation</a>
</Link>{' '}
or{' '}
<Link href="/client/test3">Perform client side navigation</Link> or{' '}
<a href="/client/test3" target="_blank">
Open in a new tab
</a>
......@@ -153,10 +141,7 @@ const Index = () => (
There is an unhandled Promise rejection during React lifecycle. In
this case, when the component mounts. Sentry should record
Error('Client Test 4').{' '}
<Link href="/client/test4">
<a>Perform client side navigation</a>
</Link>{' '}
or{' '}
<Link href="/client/test4">Perform client side navigation</Link> or{' '}
<a href="/client/test4" target="_blank">
Open in a new tab
</a>
......@@ -165,10 +150,7 @@ const Index = () => (
An Error is thrown from an event handler. Sentry should record
Error('Client Test 5'). (This page also demonstrates how to manually
instrument your code for performance monitoring.){' '}
<Link href="/client/test5">
<a>Perform client side navigation</a>
</Link>{' '}
or{' '}
<Link href="/client/test5">Perform client side navigation</Link> or{' '}
<a href="/client/test5" target="_blank">
Open in a new tab
</a>
......
......@@ -10,30 +10,28 @@ export default function ProductCard({ product }) {
const [isLoading, setLoading] = useState(true)
return (
<Link href={`/products/${product.id}`}>
<a className="group">
<div className="aspect-w-1 aspect-h-1 w-full overflow-hidden rounded-lg bg-gray-200 xl:aspect-w-7 xl:aspect-h-8">
<Image
alt=""
src={product.imageGroups[0].images[0].link}
fill
className={cn(
'object-cover duration-700 ease-in-out group-hover:opacity-75 ',
isLoading
? 'scale-110 blur-2xl grayscale'
: 'scale-100 blur-0 grayscale-0'
)}
onLoadingComplete={() => setLoading(false)}
/>
</div>
<div className="mt-4 flex items-center justify-between text-base font-medium text-gray-900">
<h3>{product.name}</h3>
<p>${product.price}</p>
</div>
<p className="mt-1 text-sm italic text-gray-500">
{product.shortDescription}
</p>
</a>
<Link href={`/products/${product.id}`} className="group">
<div className="aspect-w-1 aspect-h-1 w-full overflow-hidden rounded-lg bg-gray-200 xl:aspect-w-7 xl:aspect-h-8">
<Image
alt=""
src={product.imageGroups[0].images[0].link}
fill
className={cn(
'object-cover duration-700 ease-in-out group-hover:opacity-75 ',
isLoading
? 'scale-110 blur-2xl grayscale'
: 'scale-100 blur-0 grayscale-0'
)}
onLoadingComplete={() => setLoading(false)}
/>
</div>
<div className="mt-4 flex items-center justify-between text-base font-medium text-gray-900">
<h3>{product.name}</h3>
<p>${product.price}</p>
</div>
<p className="mt-1 text-sm italic text-gray-500">
{product.shortDescription}
</p>
</Link>
)
}
......@@ -25,9 +25,7 @@ export default function Index({ initialPropsCounter }) {
return (
<div>
<h2>This is the Home Page</h2>
<Link href="/about">
<a>About</a>
</Link>
<Link href="/about">About</Link>
<button onClick={reload}>Reload</button>
<button onClick={incrementCounter}>Change State Counter</button>
<p>"getServerSideProps" ran for "{initialPropsCounter}" times.</p>
......
......@@ -6,9 +6,7 @@ export default function Post({ title, body, id }: PostData) {
<article>
<h2>{title}</h2>
<p>{body}</p>
<Link href={`/post/${id}`}>
<a>Read more...</a>
</Link>
<Link href={`/post/${id}`}>Read more...</Link>
</article>
)
}
......@@ -47,9 +47,7 @@ const Post: NextPage<PostDataProps> = ({ postData }: PostDataProps) => {
<p>{postData.body}</p>
<Link href="/">
<a>Go back to home</a>
</Link>
<Link href="/">Go back to home</Link>
</main>
)
}
......
......@@ -32,17 +32,26 @@ export const Page: React.FC<PageProps> = ({
<p>This example combines the following other examples:</p>
<ul>
<li>
<Link href="https://github.com/vercel/next.js/tree/canary/examples/with-storybook">
<Link
href="https://github.com/vercel/next.js/tree/canary/examples/with-storybook"
legacyBehavior
>
<a>with-storybook</a>
</Link>
</li>
<li>
<Link href="https://github.com/next.js/tree/canary/examples/with-styled-jsx-scss">
<Link
href="https://github.com/next.js/tree/canary/examples/with-styled-jsx-scss"
legacyBehavior
>
<a>with-styled-jsx-scss</a>
</Link>
</li>
<li>
<Link href="https://github.com/next.js/tree/canary/examples/with-styled-jsx-scss">
<Link
href="https://github.com/next.js/tree/canary/examples/with-styled-jsx-scss"
legacyBehavior
>
<a>with-typescript</a>
</Link>
</li>
......@@ -62,7 +71,10 @@ export const Page: React.FC<PageProps> = ({
</p>
<p>
You might also want to check out the{' '}
<Link href="https://github.com/vercel/styled-jsx#styles-outside-of-components">
<Link
href="https://github.com/vercel/styled-jsx#styles-outside-of-components"
legacyBehavior
>
<a>Styled JSX documentation</a>
</Link>
</p>
......
......@@ -31,10 +31,8 @@ const Layout = ({
<div className="container">
<header>
<div className="header-content">
<Link href="/">
<a className="logo">
<img src="/logo.png" />
</a>
<Link href="/" className="logo">
<img src="/logo.png" />
</Link>
<h1>
<span className="light">Stripe Sample</span>
......
......@@ -7,27 +7,30 @@ const IndexPage: NextPage = () => {
<Layout title="Home | Next.js + TypeScript Example">
<ul className="card-list">
<li>
<Link href="/donate-with-checkout">
<a className="card checkout-style-background">
<h2 className="bottom">Donate with Checkout</h2>
<img src="/checkout-one-time-payments.svg" />
</a>
<Link
href="/donate-with-checkout"
className="card checkout-style-background"
>
<h2 className="bottom">Donate with Checkout</h2>
<img src="/checkout-one-time-payments.svg" />
</Link>
</li>
<li>
<Link href="/donate-with-elements">
<a className="card elements-style-background">
<h2 className="bottom">Donate with Elements</h2>
<img src="/elements-card-payment.svg" />
</a>
<Link
href="/donate-with-elements"
className="card elements-style-background"
>
<h2 className="bottom">Donate with Elements</h2>
<img src="/elements-card-payment.svg" />
</Link>
</li>
<li>
<Link href="/use-shopping-cart">
<a className="card cart-style-background">
<h2 className="bottom">Use Shopping Cart</h2>
<img src="/use-shopping-cart.png" />
</a>
<Link
href="/use-shopping-cart"
className="card cart-style-background"
>
<h2 className="bottom">Use Shopping Cart</h2>
<img src="/use-shopping-cart.png" />
</Link>
</li>
</ul>
......
......@@ -33,7 +33,7 @@ const StyledA = styled.a`
`
const StyledLink = ({ href, name }) => (
<Link href={href} passHref>
<Link href={href} passHref legacyBehavior>
<StyledA>{name}</StyledA>
</Link>
)
......
......@@ -7,9 +7,7 @@ export default function About() {
<Main>
<Title>About Page</Title>
<Description>
<Link href="/">
<a>&larr; Go Back</a>
</Link>
<Link href="/">&larr; Go Back</Link>
</Description>
</Main>
</Container>
......
......@@ -99,9 +99,7 @@ const Index = () => {
)}
<Typography.Text>
<Link href="/profile">
<a>SSR example with getServerSideProps</a>
</Link>
<Link href="/profile">SSR example with getServerSideProps</Link>
</Typography.Text>
</>
)}
......
......@@ -18,9 +18,7 @@ export default function Profile({ user }) {
</Typography.Text>
<Typography.Text>
<Link href="/">
<a>Static example with useSWR</a>
</Link>
<Link href="/">Static example with useSWR</Link>
</Typography.Text>
</Space>
</Card>
......
......@@ -14,13 +14,7 @@ const Layout = ({ children, title = 'This is the default title' }: Props) => (
</Head>
<header>
<nav>
<Link href="/">
<a>Home</a>
</Link>{' '}
|{' '}
<Link href="/about">
<a>About</a>
</Link>{' '}
<Link href="/">Home</Link> | <Link href="/about">About</Link>{' '}
</nav>
</header>
{children}
......
......@@ -7,9 +7,7 @@ const AboutPage: NextPage = () => (
<h1>About</h1>
<p>This is the about page</p>
<p>
<Link href="/">
<a>Go home</a>
</Link>
<Link href="/">Go home</Link>
</p>
</Layout>
)
......
......@@ -23,9 +23,7 @@ const IndexPage = () => (
</button>
<p>
<Link href="/about">
<a>About</a>
</Link>
<Link href="/about">About</Link>
</p>
</Layout>
)
......
......@@ -3,12 +3,7 @@ import Link from 'next/link'
const Nav = () => {
return (
<nav>
<Link href="/">
<a>Experiments</a>
</Link>{' '}
<Link href="/features">
<a>Features</a>
</Link>
<Link href="/">Experiments</Link> <Link href="/features">Features</Link>
</nav>
)
}
......
......@@ -3,12 +3,8 @@ import Link from 'next/link'
export default function IndexPage() {
return (
<div className="main">
<Link href="/birds">
<a>Birds Example</a>
</Link>
<Link href="/boxes">
<a>Boxes Example</a>
</Link>
<Link href="/birds">Birds Example</Link>
<Link href="/boxes">Boxes Example</Link>
</div>
)
}
......@@ -36,6 +36,7 @@ export default function GlobalNav() {
'block rounded-md px-3 py-2 text-sm font-medium hover:bg-zinc-800 hover:text-zinc-100',
{ 'text-zinc-400': !isActive, 'text-white': isActive },
)}
legacyBehavior
>
{item.name}
</Link>
......
......@@ -25,6 +25,7 @@ export default function Page() {
href={`/${item.slug}`}
key={item.name}
className="block space-y-1.5 rounded-lg border border-white/10 px-4 py-3 hover:border-white/20"
legacyBehavior
>
<div>{item.name}</div>
......
......@@ -9,7 +9,7 @@ export const SectionLink = ({
href: string;
text: string;
}) => (
<Link href={href} className="group block space-y-2">
<Link href={href} className="group block space-y-2" legacyBehavior>
<div className="-m-[5px] rounded-[20px] border border-zinc-900 p-1 transition group-hover:border-blue-600">
{children}
</div>
......
......@@ -18,6 +18,7 @@ export const TabNavItem = ({
!isActive,
'bg-vercel-blue text-white': isActive,
})}
legacyBehavior
>
{children}
</Link>
......
......@@ -3,11 +3,7 @@ import Link from 'next/link'
export default function About() {
return (
<div>
Welcome to the about page. Go to the{' '}
<Link href="/">
<a>Home</a>
</Link>{' '}
page.
Welcome to the about page. Go to the <Link href="/">Home</Link> page.
</div>
)
}
......@@ -63,10 +63,7 @@ const Index = () => {
return viewer ? (
<div>
You're signed in as {viewer.name} and you're {viewer.status}. Go to the{' '}
<Link href="/about">
<a>about</a>
</Link>{' '}
page.
<Link href="/about">about</Link> page.
<div>
<input
type="text"
......
......@@ -16,18 +16,9 @@ const Layout = ({ children, title = 'This is the default title' }: Props) => (
</Head>
<header>
<nav>
<Link href="/">
<a>Home</a>
</Link>{' '}
|{' '}
<Link href="/about">
<a>About</a>
</Link>{' '}
|{' '}
<Link href="/users">
<a>Users List</a>
</Link>{' '}
| <a href="/api/users">Users API</a>
<Link href="/">Home</Link> | <Link href="/about">About</Link> |{' '}
<Link href="/users">Users List</Link> |{' '}
<a href="/api/users">Users API</a>
</nav>
</header>
{children}
......
......@@ -9,9 +9,7 @@ type Props = {
const ListItem = ({ data }: Props) => (
<Link href="/users/[id]" as={`/users/${data.id}`}>
<a>
{data.id}: {data.name}
</a>
{data.id}:{data.name}
</Link>
)
......
......@@ -6,9 +6,7 @@ const AboutPage = () => (
<h1>About</h1>
<p>This is the about page</p>
<p>
<Link href="/">
<a>Go home</a>
</Link>
<Link href="/">Go home</Link>
</p>
</Layout>
)
......
......@@ -5,9 +5,7 @@ const IndexPage = () => (
<Layout title="Home | Next.js + TypeScript Example">
<h1>Hello Next.js 👋</h1>
<p>
<Link href="/about">
<a>About</a>
</Link>
<Link href="/about">About</Link>
</p>
</Layout>
)
......
......@@ -19,9 +19,7 @@ const WithStaticProps = ({ items }: Props) => (
<p>You are currently on: /users</p>
<List items={items} />
<p>
<Link href="/">
<a>Go home</a>
</Link>
<Link href="/">Go home</Link>
</p>
</Layout>
)
......
......@@ -21,26 +21,24 @@ const Collections = ({ id_collection }: CollectionProps) => {
<div className={styles.chips}>
{data.map(({ id, title, slug }) =>
id_collection ? (
<Link href="/" key={`collection_${slug}`}>
<a className={styles.chip}>
{title}
<Link href="/">
<button
type="button"
className={styles.chip_remove}
aria-label="Return to home"
></button>
</Link>
</a>
<Link href="/" key={`collection_${slug}`} className={styles.chip}>
{title}
<Link href="/" legacyBehavior>
<button
type="button"
className={styles.chip_remove}
aria-label="Return to home"
></button>
</Link>
</Link>
) : (
<Link
href={{ pathname: '/collection/[slug]', query: { id: id } }}
as={`/collection/${slug}?id=${id}`}
key={`collection_${slug}`}
className={styles.chip}
>
<a className={styles.chip}>{title}</a>
{title}
</Link>
)
)}
......
......@@ -12,20 +12,16 @@ const User = () => {
return (
<header className={styles.header}>
<Link href="/">
<a>
{data && (
<img
src={data.profile_image.large}
className={`${styles.headerImage} ${styles.borderCircle}`}
alt={data.name}
/>
)}
</a>
{data && (
<img
src={data.profile_image.large}
className={`${styles.headerImage} ${styles.borderCircle}`}
alt={data.name}
/>
)}
</Link>
<h2 className={styles.headingLg}>
<Link href="/">
<a>{data ? data.name : ''}</a>
</Link>
<Link href="/">{data ? data.name : ''}</Link>
</h2>
{data ? <Social user={data} /> : ''}
......
......@@ -9,9 +9,7 @@ export default function Index() {
<CounterContainer.Provider>
<ClockContainer.Provider>
<div>
<Link href="/">
<a>go to Index</a>
</Link>
<Link href="/">go to Index</Link>
<br />
<br />
<div>
......
......@@ -9,9 +9,7 @@ export default function Index() {
<CounterContainer.Provider>
<ClockContainer.Provider>
<div>
<Link href="/about">
<a>go to About</a>
</Link>
<Link href="/about">go to About</Link>
<br />
<br />
<div>
......
......@@ -7,10 +7,8 @@ export default function Home({ pokemons }) {
{pokemons.map((pokemon) => (
<li key={pokemon.name}>
<Link as={`/pokemon/${pokemon.name}`} href="/pokemon/[name]">
<a>
<h2 style={{ textTransform: 'capitalize' }}>{pokemon.name}</h2>
<img src={pokemon.image} alt={`${pokemon.name} picture`} />
</a>
<h2 style={{ textTransform: 'capitalize' }}>{pokemon.name}</h2>
<img src={pokemon.image} alt={`${pokemon.name} picture`} />
</Link>
</li>
))}
......
......@@ -5,9 +5,7 @@ export default function Index({ stars }) {
return (
<div>
<p>Next.js has {stars} ⭐️</p>
<Link href="/preact">
<a>How about preact?</a>
</Link>
<Link href="/preact">How about preact?</Link>
</div>
)
}
......
......@@ -5,9 +5,7 @@ export default function Preact({ stars }) {
return (
<div>
<p>Preact has {stars} ⭐</p>
<Link href="/">
<a>I bet Next.js has more stars (?)</a>
</Link>
<Link href="/">I bet Next.js has more stars (?)</Link>
</div>
)
}
......
......@@ -16,9 +16,7 @@ const Page = ({ router: { query } }) => {
return (
<div>
<RustComponent number={number} />
<Link href={`/?number=${number + 1}`}>
<a>+</a>
</Link>
<Link href={`/?number=${number + 1}`}>+</Link>
</div>
)
}
......
......@@ -7,14 +7,10 @@ export default function Blog() {
<h3>This is our blog</h3>
<ul>
<li>
<Link href="/post/1">
<a>Post 1</a>
</Link>
<Link href="/post/1">Post 1</Link>
</li>
<li>
<Link href="/post/2">
<a>Post 2</a>
</Link>
<Link href="/post/2">Post 2</Link>
</li>
</ul>
<a href="/">Home</a>
......
......@@ -7,9 +7,7 @@ export default function Post() {
<div>
<h3>Post #{router.query.id}</h3>
<p>Lorem ipsum</p>
<Link href="/">
<a>Back to blog</a>
</Link>
<Link href="/">Back to blog</Link>
</div>
)
}
......@@ -4,9 +4,7 @@ const About = () => (
<div>
<p>This is the about page.</p>
<div>
<Link href="/">
<a>Go Back</a>
</Link>
<Link href="/">Go Back</Link>
</div>
<img width={200} src="/static/vercel.png" />
</div>
......
......@@ -13,9 +13,7 @@ export default function Home() {
<a href="/blog">Blog</a>
</div>
<div>
<Link href="/about">
<a>About us</a>
</Link>
<Link href="/about">About us</Link>
</div>
<Image
src="/static/nextjs.png"
......
......@@ -3,13 +3,13 @@ import Link from 'next/link'
const Nav = () => {
return (
<nav>
<Link href="/">
<Link href="/" legacyBehavior>
<a>Index</a>
</Link>
<Link href="/ssg">
<Link href="/ssg" legacyBehavior>
<a>SSG</a>
</Link>
<Link href="/ssr">
<Link href="/ssr" legacyBehavior>
<a>SSR</a>
</Link>
<style jsx>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment