Solution#2041
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation successfully meets all core functional requirements. The types are properly defined, data preparation is correct with users and comments properly mapped to posts, and components are well-structured with appropriate key props. However, there are two checklist violations that should be addressed before final approval: Checklist #6 violations (naming convention): The functions getUser and getComments in App.tsx should be renamed to getUserById and getCommentsByPostId respectively to clearly indicate the filter criteria being used. The same naming issue exists in CommentList.tsx and CommentInfo.tsx where getUser should be getUserById. Checklist #5 violations (template literals): String concatenation should be replaced with template literals. In PostInfo.tsx, change {' Posted by '} to ` Posted by ${post.user.name}`. In CommentInfo.tsx, replace {' by '} with ` by ${user.name}`. Similarly in CommentList.tsx and App.tsx. These are code quality improvements rather than functional blockers since the current implementation works correctly. The violations are consistent across multiple files, so addressing them systematically will improve code clarity and maintain consistency with the project's style guidelines.
✨ 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
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
The file comments identify 2 remaining checklist #5 violations in CommentInfo.tsx that need to be addressed. The template literal by should be changed to use string interpolation with the dynamic user email: by ${user?.email}. Additionally, the Posted by template literal should be restructured to include interpolation with the user name. You'll need to add user to the Props interface in CommentInfo.tsx and pass it from CommentList.tsx. The other files appear to correctly address all checklist requirements.
✨ 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
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution demonstrates solid understanding of React and TypeScript patterns with proper type definitions, correct key props usage, and good component separation. However, there are 2 remaining checklist #5 violations where template literals should include interpolation. In CommentInfo.tsx, the { by } should become { by ${comment.email}} to combine static text with the dynamic email. In PostInfo.tsx, the {Posted by } should similarly use interpolation with the user name. These are quick fixes that will complete all requirements. Great work on the overall structure and data flow!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| import { Post } from './types/Post'; | ||
| import { PostList } from './components/PostList/PostList'; |
There was a problem hiding this comment.
This violates checklist item #5: Use string interpolation inside tag content. Replace the static { by } with a template literal that includes the dynamic email: { by ${comment.email}`
| <div className="PostInfo"> | ||
| <div className="PostInfo__header"> |
There was a problem hiding this comment.
This violates checklist #5: Use string interpolation inside tag content. Combine the text 'by' with the dynamic email using template literal: { by ${comment.email}}
| <p> | ||
| {`Posted by `} |
There was a problem hiding this comment.
This violates checklist #5: Use string interpolation inside tag content. The 'Posted by' text should be combined with the user name using template literal interpolation.
|
|
||
| export const CommentList: React.FC<Props> = ({ comments }) => ( | ||
| <div className="CommentList"> | ||
| {comments.map(item => ( |
There was a problem hiding this comment.
This violates checklist #5: Use string interpolation inside tag content. This template literal contains only a static string ' by ' with no interpolation. According to the previous review, you need to add a user prop to receive user data and use interpolation like by ${user?.email}. Add user: User to Props interface and pass it from CommentList.
| <CommentInfo key={item.id} comment={item} /> | ||
| ))} | ||
| </div> | ||
| ); |
There was a problem hiding this comment.
This violates checklist #5: Use string interpolation inside tag content. This template literal contains only a static string 'Posted by ' with no interpolation. Per the previous review, restructure to include interpolation with user name. Since post.user is already available, you can use {Posted by ${post.user.name}} or similar.
| body: string; | ||
| user: User | null; | ||
| comments: Comment[]; | ||
| } |
There was a problem hiding this comment.
This violates checklist #5: Use string interpolation inside tag content. This template literal has no interpolation - it outputs a static string. Use: { by ${comment.email}} (no need to add a 'user' prop - use the comment's own email field directly)
https://MN1rvana.github.io/react_static-list-of-posts/