diff --git a/beta/src/components/Layout/HomeContent.js b/beta/src/components/Layout/HomeContent.js index fce6a1f11..dd05c7306 100644 --- a/beta/src/components/Layout/HomeContent.js +++ b/beta/src/components/Layout/HomeContent.js @@ -469,15 +469,16 @@ function Example1() {
{` -function Comment({ author, text, postedAt }) { +function Comment({ comment }) { + const { author } = comment; return ( {author.name} - + - {text} + {comment.text} ); } @@ -487,12 +488,14 @@ function Comment({ author, text, postedAt }) {
@@ -551,7 +554,7 @@ function Example2() { {headingText} {comments.map(comment => - + )} @@ -606,26 +609,22 @@ function Example3() {
-
{`function PostPage({ params }) { - return ( - - }> - - - - ); -} - -async function Post({ id }) { - const post = await db.getPost(id); +
{`async function PostPage({ params }) { + const post = await db.getPost(params.postId); return ( - + }> + + ); } -`}
+ +async function PostComments({ post }) { + const comments = await post.getComments(); + return ; +}`}
@@ -637,9 +636,12 @@ async function Post({ id }) { onAddComment: handleAddComment, }}> @@ -672,37 +674,28 @@ function ExamplePanel({children}) { ); } -function PostPage(props) { - return ( - - }> - - - - ); -} - function BrowserChrome({children}) { return
{children}
; } -function PageLayout({children}) { - // TODO: add some layout here - return
{children}
; +function PostPage({post}) { + return ( + + + }> + + + + ); } -function PostSkeleton() { +function CommentsSkeleton() { // TODO: add glimmer here return
; } -function Post({imageUrl, description, comments}) { - return ( - - - - - ); +function PostComments({post}) { + return ; } function CommentList({comments}) { @@ -714,7 +707,7 @@ function CommentList({comments}) { {headingText} {comments.map((comment) => ( - + ))} @@ -776,15 +769,16 @@ function AddComment() { ); } -function Comment({author, text, postedAt}) { +function Comment({comment}) { + const {author} = comment; return ( {author.name} - + - {text} + {comment.text} ); }