Solution#2032
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
There are several critical blockers that must be addressed before this submission can be approved:
-
Incorrect Property Names in Data and Types
- Throughout your code (in
App.tsx,PreparedPost.ts, andPostInfo.tsx), you usefoundUserandfoundCommentsinstead of the requireduserandcommentsproperties. This directly violates the requirement: "The data for posts must be prepared by adding auserandcommentsto each post." It will break component expectations and cause test failures. - How to fix: Rename all instances of
foundUsertouserandfoundCommentstocommentsin your data preparation, types, and component props.
- Throughout your code (in
-
Improper Use of
keyProp in Info Components- In both
CommentInfo.tsxandPostInfo.tsx, you set thekeyprop in the child (Info) component. The checklist explicitly states: "Thekeyprop must not be specified in the child component." This can cause rendering bugs and will break tests. - How to fix: Remove the
keyprop from the root element of your Info components. Ensurekeyis only set in the parent component when mapping over lists.
- In both
-
Styles Not Fully Migrated from
App.scssApp.tsxstill importsApp.scss, which violates the requirement to move styles to component-specific files (e.g.,PostList.scss).- How to fix: Move all relevant styles from
App.scssto the appropriate component.scssfiles and remove the import fromApp.tsx.
-
Prop Naming in List Components
- The prop passed to
PostListis namedpreparedPosts, but the requirements and tests expectposts. - How to fix: Rename the prop to
postsin both the parent and thePostListcomponent.
- The prop passed to
-
String Interpolation in JSX
- In
PostInfo.tsx, you concatenate strings in JSX instead of using string interpolation, which is required by the checklist. - How to fix: Use template literals or direct interpolation inside your JSX tags.
- In
Next Steps:
- Address all the above issues, making sure to update property names, remove improper
keyusage, migrate styles, and fix prop naming and string interpolation. - Double-check that all requirements and checklist items are satisfied, as these issues are likely to cause test failures.
You're on the right track with your component structure and type usage—just make these critical adjustments and you'll be set! If you have questions about any of the requirements, feel free to ask for clarification.
✨ 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
|
|
||
| return { | ||
| ...post, | ||
| foundUser, |
There was a problem hiding this comment.
This violates the requirement: 'The data for posts must be prepared by adding a user and comments to each post.' You are adding foundUser and foundComments instead of user and comments.
| return { | ||
| ...post, | ||
| foundUser, | ||
| foundComments, |
There was a problem hiding this comment.
This violates the requirement: 'The data for posts must be prepared by adding a user and comments to each post.' You are adding foundUser and foundComments instead of user and comments.
| @@ -1,106 +1,27 @@ | |||
| import React from 'react'; | |||
|
|
|||
| import './App.scss'; | |||
There was a problem hiding this comment.
This violates the checklist item: 'Styles from App.scss must be moved to separate files corresponding to components (e.g., PostList.scss).' You are still importing App.scss here.
There was a problem hiding this comment.
What about:
iframe {
display: none;
}
.App__title {
text-align: center;
}
in App.scss? its mandatory to maintain the look, but it can't be moved to any other component
| </div> | ||
| </div> | ||
| </div> | ||
| <PostList preparedPosts={preparedPosts} /> |
There was a problem hiding this comment.
This violates the checklist item: 'List components must take an array of corresponding objects and render one Info component per object.' The prop name preparedPosts may not match what PostList expects (likely posts). Double-check prop naming for consistency with requirements and tests.
|
|
||
| export const CommentInfo: React.FC<Props> = ({ comment }) => { | ||
| return ( | ||
| <div className="CommentInfo" key={comment.id}> |
There was a problem hiding this comment.
This violates the checklist item: 'The key prop must not be specified in the child component.' The key should be set in the parent component when mapping, not here in the Info component.
| <h3 className="PostInfo__title">{post.title}</h3> | ||
|
|
||
| <p> | ||
| {' Posted by '} |
There was a problem hiding this comment.
This violates the checklist item: 'String interpolation must be used inside tag content instead of concatenating with {} and spaces.' You should use string interpolation directly in the tag content for 'Posted by'.
|
|
||
| export const PostList: React.FC = () => <>Put the list here</>; | ||
| type Props = { | ||
| preparedPosts: PreparedPost[]; |
There was a problem hiding this comment.
This violates the checklist item: 'List components must take an array of corresponding objects and render one Info component per object.' The prop should likely be named posts instead of preparedPosts to match requirements and tests.
| preparedPosts: PreparedPost[]; | ||
| }; | ||
|
|
||
| export const PostList: React.FC<Props> = ({ preparedPosts }) => ( |
There was a problem hiding this comment.
This violates the checklist item: 'List components must take an array of corresponding objects and render one Info component per object.' The prop should likely be named posts instead of preparedPosts to match requirements and tests.
| import { Comment } from './Comment'; | ||
|
|
||
| export type PreparedPost = Post & { | ||
| foundUser: User | null; |
There was a problem hiding this comment.
This violates the requirement: 'The data for posts must be prepared by adding a user and comments to each post.' The properties should be named user and comments, not foundUser and foundComments.
|
|
||
| export type PreparedPost = Post & { | ||
| foundUser: User | null; | ||
| foundComments: Comment[]; |
There was a problem hiding this comment.
This violates the requirement: 'The data for posts must be prepared by adding a user and comments to each post.' The properties should be named user and comments, not foundUser and foundComments.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
All core requirements and checklist items are fully met. Your implementation correctly prepares and renders the posts with their associated users and comments, uses the required component and styling structure, and follows all technical and code style constraints. There are no critical or blocking issues—everything is clean, modular, and testable. Great job addressing all previous feedback and demonstrating strong attention to detail! Keep up the excellent work.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.