Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move orphaned title to component structure for document-field example #9064

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 19 additions & 17 deletions examples/document-field/src/pages/index.tsx
Expand Up @@ -5,24 +5,26 @@ import { fetchGraphQL, gql } from '../utils'
type Author = { id: string, name: string, posts: { id: string, slug: string, title: string }[] }

export default function Index ({ authors }: { authors: Author[] }) {
<h1>Keystone Blog Project - Home</h1>
return (
<ul>
{authors.map(author => (
<li key={author.id}>
<h2>
<Link href={`/author/${author.id}`}>{author.name}</Link>
</h2>
<ul>
{author.posts.map(post => (
<li key={post.id}>
<Link href={`/post/${post.slug}`}>{post.title}</Link>
</li>
))}
</ul>
</li>
))}
</ul>
<>
<h1>Keystone Blog Project - Home</h1>
<ul>
{authors.map(author => (
<li key={author.id}>
<h2>
<Link href={`/author/${author.id}`}>{author.name}</Link>
</h2>
<ul>
{author.posts.map(post => (
<li key={post.id}>
<Link href={`/post/${post.slug}`}>{post.title}</Link>
</li>
))}
</ul>
</li>
))}
</ul>
</>
)
}

Expand Down