Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Krot Max committed Feb 6, 2025
1 parent d6a8d49 commit 4cab8bb
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 31 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ This task is similar to [Static List of TODOs](https://github.com/mate-academy/r
- Install Prettier Extention and use this [VSCode settings](https://mate-academy.github.io/fe-program/tools/vscode/settings.json) to enable format on save.
- Implement a solution following the [React task guideline](https://github.com/mate-academy/react_task-guideline#react-tasks-guideline).
- Open one more terminal and run tests with `npm test` to ensure your solution is correct.
- Replace `<your_account>` with your Github username in the [DEMO LINK](https://<your_account>.github.io/react_static-list-of-posts-js/) and add it to the PR description.
- Replace `<your_account>` with your Github username in the [DEMO LINK](https://Maas1m.github.io/react_static-list-of-posts-js/) and add it to the PR description.
15 changes: 5 additions & 10 deletions src/components/CommentInfo/CommentInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,19 @@ export const CommentInfo = ({comment}) =>
className="CommentInfo__email"
href="mailto:[email protected]"
>
[email protected]
{comment.email}
</a>
</div>

<div className="CommentInfo__body">
dolorum voluptas laboriosam quisquam ab totam beatae et aut
aliquid optio assumenda voluptas velit itaque quidem voluptatem
tempore cupiditate in itaque sit molestiae minus dolores magni
{comment.body}
</div>
</div>

<div className="CommentInfo">
<div className="CommentInfo__title">
<strong className="CommentInfo__name">
odio adipisci rerum aut animi
{comment.name}
</strong>

{' by '}
Expand All @@ -33,15 +31,12 @@ export const CommentInfo = ({comment}) =>
className="CommentInfo__email"
href="mailto:[email protected]"
>
[email protected]
{comment.email}
</a>
</div>

<div className="CommentInfo__body">
quia molestiae reprehenderit quasi aspernatur aut expedita
occaecati aliquam eveniet laudantium omnis quibusdam delectus
saepe quia accusamus maiores nam est cum et ducimus et vero
voluptates excepturi deleniti ratione
{comment.body}
</div>
</div>

Expand Down
45 changes: 26 additions & 19 deletions src/components/PostInfo/PostInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,32 @@ import { CommentList } from "../CommentList/CommentList";
import { UserInfo } from "../UserInfo/UserInfo";


export const PostInfo = ({post }) =>
<div className="PostInfo">
<div className="PostInfo__header">
<h3 className="PostInfo__title">{ post.title}</h3>

<p>
{' Posted by '}

<UserInfo user={user} />
</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>
export const PostInfo = ({ post }) =>
<div className="PostInfo">
<div className="PostInfo__header">
<h3 className="PostInfo__title">{post.title}</h3>

<hr />
<p>
{' Posted by '}

Check failure on line 12 in src/components/PostInfo/PostInfo.jsx

View workflow job for this annotation

GitHub Actions / run_linter (20.x)

'user' is not defined
<b data-cy="NoCommentsMessage">No comments yet <CommentList comments={commentsFromServer} /></b>
<UserInfo user={user} />
</p>
</div>

<p className="PostInfo__body">
{post.body}
</p>

<hr />

Check failure on line 21 in src/components/PostInfo/PostInfo.jsx

View workflow job for this annotation

GitHub Actions / run_linter (20.x)

'comment' is not defined

Check failure on line 22 in src/components/PostInfo/PostInfo.jsx

View workflow job for this annotation

GitHub Actions / run_linter (20.x)

'commentsFromServer' is not defined
<b data-cy="NoCommentsMessage">{comment ? <CommentList comments={commentsFromServer} /> : 'No comments yet'} </b>

<b data-cy="NoCommentsMessage">No comments yet</b>
</div>

// < a
// className = "CommentInfo__email"
// href = "mailto:[email protected]"
// >
// Nikita@garfield.biz
// </a >
2 changes: 1 addition & 1 deletion src/components/UserInfo/UserInfo.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const UserInfo = () =>
export const UserInfo = ({user}) =>
<a className="UserInfo" href={`mailto:${user.email}`}>
{user.name}
</a>
Expand Down

0 comments on commit 4cab8bb

Please sign in to comment.