-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61f14ea
commit d633c4d
Showing
10 changed files
with
50 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import './CommentList.scss'; | ||
|
||
import { CommentInfo } from '../CommentInfo'; | ||
|
||
export const CommentList = ({ comments }) => ( | ||
<div className="CommentList"> | ||
{comments.map(comment => ( | ||
<div className="CommentInfo"> | ||
<CommentInfo comment={comment} /> | ||
</div> | ||
<CommentInfo key={comment.id} comment={comment} /> | ||
))} | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
// add styles here | ||
|
||
.CommentList { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.7em; | ||
background-color: #eee; | ||
padding: 1em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
import './PostInfo.scss'; | ||
|
||
import { UserInfo } from '../UserInfo'; | ||
import { CommentList } from '../CommentList'; | ||
|
||
export const PostInfo = ({ post }) => ( | ||
<> | ||
<div className="PostInfo"> | ||
<div className="PostInfo__header"> | ||
<h3 className="PostInfo__title">{post.title}</h3> | ||
<UserInfo user={post.user} /> | ||
</div> | ||
<p className="PostInfo__body">{post.body}</p> | ||
</> | ||
{post.comments.length > 0 ? ( | ||
<CommentList comments={post.comments} /> | ||
) : ( | ||
<b data-cy="NoCommentsMessage">No comments yet</b> | ||
)} | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
// add styles here | ||
|
||
.PostInfo { | ||
margin: 10px auto; | ||
width: 90%; | ||
border: 1px solid #000; | ||
border-radius: 8px; | ||
background-color: lightgray; | ||
padding: 1em; | ||
|
||
&__title { | ||
margin: 0; | ||
} | ||
|
||
&__header { | ||
margin-bottom: 1em; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,9 @@ | ||
import { CommentList } from '../CommentList'; | ||
import { PostInfo } from '../PostInfo'; | ||
|
||
export const PostList = ({ posts }) => ( | ||
<div className="PostList"> | ||
{/* <div className="PostInfo"> | ||
<div className="PostInfo__header"> | ||
<h3 className="PostInfo__title">qui est esse</h3> | ||
<p> | ||
{' Posted by '} | ||
<a className="UserInfo" href="mailto:[email protected]"> | ||
Leanne Graham | ||
</a> | ||
</p> | ||
</div> | ||
<p className="PostInfo__body"> | ||
est rerum tempore vitae sequi sint nihil reprehenderit dolor beatae ea | ||
dolores neque fugiat blanditiis voluptate porro vel nihil molestiae ut | ||
reiciendis qui aperiam non debitis possimus qui neque nisi nulla | ||
</p> | ||
<hr /> | ||
<b data-cy="NoCommentsMessage">No comments yet</b> | ||
</div> */} | ||
|
||
{posts.map(post => ( | ||
<div className="PostInfo"> | ||
<PostInfo key={post.id} post={post} /> | ||
<CommentList comments={post.comments} /> | ||
</div> | ||
<PostInfo key={post.id} post={post} /> | ||
))} | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import './UserInfo.scss'; | ||
|
||
export const UserInfo = ({ user }) => ( | ||
<p> | ||
Posted by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
// add styles here | ||
|
||
.UserInfo { | ||
font-weight: bold; | ||
} |