-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Solution #1338
Conversation
There was a problem hiding this 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:
-
Data Handling in
PostInfo.jsx
: There are several instances where properties likecommentsFromServer.name
,commentsFromServer.email
, andcommentsFromServer.body
are accessed directly. You should iterate over the comments and access these properties from each individual comment object instead. -
Incorrect Function Usage: The
getCommentById
function is incorrectly used and is searching inusersFromServer
instead ofcommentsFromServer
. This will lead to incorrect data retrieval for comments. -
href
Attribute Issue: InUserInfo.jsx
, there's an extra closing brace in thehref
attribute string:mailto:${user.email}}
. It should bemailto:${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.
function getCommentById(commentId) { | ||
return usersFromServer.find(comment => comment.id === commentId) || null; |
There was a problem hiding this comment.
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.
export const comment = commentsFromServer.map(comment => ({ | ||
...comment, | ||
user: getCommentById(comment.commentId), | ||
})); |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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}}`} |
There was a problem hiding this comment.
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)} |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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}}`} |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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}}`}> |
There was a problem hiding this comment.
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.
https://Maas1m.github.io/react_static-list-of-posts-js/