Skip to content

add task solution#2025

Open
ihorkrasnozhon wants to merge 2 commits into
mate-academy:masterfrom
ihorkrasnozhon:develop
Open

add task solution#2025
ihorkrasnozhon wants to merge 2 commits into
mate-academy:masterfrom
ihorkrasnozhon:develop

Conversation

@ihorkrasnozhon

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Thank you for your hard work! There are a few critical issues that need to be addressed before your PR can be approved:

  • In PreparedPost.ts, the Comment type is used but not imported, which will cause a TypeScript error. Please add import { Comment } from './Comment'; at the top of the file.
  • In PostInfo.tsx, the component should use the comments prop passed to it, not import comments directly from the API. Please destructure comments from the props and remove the direct import.
  • The post body is rendered with a trailing semicolon ({post.body};), which should be removed to display only the post content.
  • In CommentInfo.tsx, the email link currently displays the comment's name as the link text. Please update it to display the actual email address ({comment.email}) so users see the correct information.

Once you fix these issues, your solution will meet all the core requirements! Keep up the great effort—you're almost there! 🚀


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment on lines +16 to +17
<a className="CommentInfo__email" href={`mailto:${comment.email}`}>
{comment.name}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: The anchor tag for the email link is displaying comment.name as the link text. It should display comment.email instead, so users can see the actual email address they are contacting. Please update the link text to {comment.email}.

Comment thread src/components/PostInfo/PostInfo.tsx Outdated
comments: Comment[];
};

export const PostInfo: React.FC<Props> = ({ post, users }) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error: The component receives a comments prop (as defined in the Props type), but it is not destructured in the function parameters. Instead, comments are imported directly from the API on line 7. According to the prop-driven design, you should use the comments prop passed to the component, not import comments here. Please destructure comments from the props and remove the import statement for comments.

Comment thread src/components/PostInfo/PostInfo.tsx Outdated
)}
</p>
</div>
<p className="PostInfo__body">{post.body};</p>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: The post body is rendered with a trailing semicolon ({post.body};). This is likely a mistake, as the semicolon should not be displayed in the post content. Please remove the semicolon so only the post body is rendered.

Comment thread src/types/PreparedPost.ts

export interface PreparedPost extends Post {
user: User;
comments: Comment[];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error: The Comment type is used here but is not imported. Please add import { Comment } from './Comment'; at the top of the file to fix the TypeScript error.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Great job! 🎉 Your code meets all the core requirements and constraints of the task. All files are present, correctly implemented, and there are no missing or broken functionalities. You addressed previous issues thoroughly, and your solution is clean and well-structured. Keep up the excellent work! If you want to further improve, consider reviewing best practices and code style, but for this task, everything looks perfect. 🚀


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants