Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution #1338

Closed
wants to merge 1 commit into from
Closed

Solution #1338

wants to merge 1 commit into from

Conversation

Maas1m
Copy link

@Maas1m Maas1m commented Feb 5, 2025

Copy link

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

Choose a reason for hiding this comment

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


Thank you for your hard work on this pull request! 😊 While you've made good progress, there are a few critical issues that need to be addressed to ensure the functionality and requirements of the task are fully met:

  1. Data Handling in PostInfo.jsx: There are several instances where properties like commentsFromServer.name, commentsFromServer.email, and commentsFromServer.body are accessed directly. You should iterate over the comments and access these properties from each individual comment object instead.

  2. Incorrect Function Usage: The getCommentById function is incorrectly used and is searching in usersFromServer instead of commentsFromServer. This will lead to incorrect data retrieval for comments.

  3. href Attribute Issue: In UserInfo.jsx, there's an extra closing brace in the href attribute string: mailto:${user.email}}. It should be mailto:${user.email} to correctly format the email link.

These issues are critical as they affect the core functionality of the application. Once these are resolved, your code will be much closer to meeting the task requirements. Keep up the great work, and don't hesitate to reach out if you need further guidance! 🚀

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

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

Comment on lines +14 to +15
function getCommentById(commentId) {
return usersFromServer.find(comment => comment.id === commentId) || null;

Choose a reason for hiding this comment

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

The getCommentById function is incorrectly searching in usersFromServer instead of commentsFromServer. This will cause incorrect data retrieval for comments.

Comment on lines +18 to +21
export const comment = commentsFromServer.map(comment => ({
...comment,
user: getCommentById(comment.commentId),
}));

Choose a reason for hiding this comment

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

The comment export is mapping over commentsFromServer, but the getCommentById function is incorrectly used here. You should ensure that the function retrieves the correct user information for each comment.

<div className="CommentList">
<div className="CommentInfo">
<div className="CommentInfo__title">
<strong className="CommentInfo__name">{commentsFromServer.name}</strong>

Choose a reason for hiding this comment

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

The commentsFromServer.name is used directly, which will not work as expected. You should iterate over the comments and access the name property of each comment.


<a
className="CommentInfo__email"
href={`mailto:${commentsFromServer.email}}`}

Choose a reason for hiding this comment

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

The href attribute is using commentsFromServer.email, which will not work as expected. You should iterate over the comments and access the email property of each comment.

className="CommentInfo__email"
href={`mailto:${commentsFromServer.email}}`}
>
{getCommentById(comment.commentId)}

Choose a reason for hiding this comment

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

The getCommentById(comment.commentId) is incorrectly used here. Ensure you are passing the correct comment data to this function.

<div className="CommentInfo">
<div className="CommentInfo__title">
<strong className="CommentInfo__name">
{commentsFromServer.name}

Choose a reason for hiding this comment

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

Similar to line 70, commentsFromServer.name is used directly. Ensure you are accessing the name property of each comment correctly.


<a
className="CommentInfo__email"
href={`mailto:${commentsFromServer.email}}`}

Choose a reason for hiding this comment

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

Similar to line 76, commentsFromServer.email is used directly. Ensure you are accessing the email property of each comment correctly.

className="CommentInfo__email"
href={`mailto:${commentsFromServer.email}}`}
>
{usersFromServer.email}

Choose a reason for hiding this comment

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

The usersFromServer.email is used directly, which is incorrect. Ensure you are accessing the correct user data associated with each comment.

</div>

<div className="CommentInfo__body">
{commentsFromServer.body}

Choose a reason for hiding this comment

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

The commentsFromServer.body is used directly. Ensure you are accessing the body property of each comment correctly.

export const UserInfo = () => <>Put the user here</>;
export const UserInfo = ({user}) =>
<>
<a className="UserInfo" href={`mailto:${user.email}}`}>

Choose a reason for hiding this comment

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

There is an extra closing brace in the href attribute string: mailto:${user.email}}. It should be mailto:${user.email} to correctly format the email link.

@Maas1m Maas1m closed this by deleting the head repository Feb 5, 2025
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