Skip to content

Commit

Permalink
fix: move orphaned title to component structure for document-field ex…
Browse files Browse the repository at this point in the history
…ample (#9064)

Co-authored-by: Maksim Grushchenko <[email protected]>
  • Loading branch information
Grumaks and Maksim Grushchenko authored Mar 20, 2024
1 parent 041dcf7 commit 29e960d
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions examples/document-field/src/pages/index.tsx
Original file line number Diff line number Diff line change
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

0 comments on commit 29e960d

Please sign in to comment.