Skip to content

Solution#2041

Open
MN1rvana wants to merge 4 commits into
mate-academy:masterfrom
MN1rvana:develop
Open

Solution#2041
MN1rvana wants to merge 4 commits into
mate-academy:masterfrom
MN1rvana:develop

Conversation

@MN1rvana

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

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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/components/CommentList/CommentList.tsx
Comment thread src/components/CommentList/CommentList.tsx
Comment thread src/components/CommentInfo/CommentInfo.tsx
Comment thread src/components/CommentInfo/CommentInfo.tsx
Comment thread src/components/CommentInfo/CommentInfo.tsx
Comment thread src/App.tsx Outdated
Comment thread src/App.tsx Outdated
Comment thread src/App.tsx Outdated
Comment thread src/components/PostInfo/PostInfo.tsx Outdated

@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

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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/components/CommentInfo/CommentInfo.tsx
Comment thread src/components/CommentInfo/CommentInfo.tsx

@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

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

  1. Rate AI review example

Comment thread src/App.tsx
Comment on lines +11 to +12
import { Post } from './types/Post';
import { PostList } from './components/PostList/PostList';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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}`

Comment on lines +11 to +12
<div className="PostInfo">
<div className="PostInfo__header">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist #5: Use string interpolation inside tag content. Combine the text 'by' with the dynamic email using template literal: { by ${comment.email}}

Comment on lines +15 to +16
<p>
{`Posted by `}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 => (

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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>
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread src/types/Post.ts
body: string;
user: User | null;
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.

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)

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