Skip to content

react person#3738

Open
vovagorbovuy wants to merge 1 commit into
mate-academy:masterfrom
vovagorbovuy:develop
Open

react person#3738
vovagorbovuy wants to merge 1 commit into
mate-academy:masterfrom
vovagorbovuy:develop

Conversation

@vovagorbovuy
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@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.

Review Summary

Your implementation correctly fulfills all functional requirements - the component renders person details properly, handles optional age, displays the correct partner relationship, and uses all required class names. While checklist item #3 recommends extracting the nested ternary into a separate variable for readability, this is a code style/readability suggestion rather than a functional blocker. The code works correctly as written, and extracting ternaries into variables is a common refactoring practice you can apply in future code. Your understanding of destructuring, conditional rendering, and component composition is solid. Great work!


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

Footnotes

  1. Rate AI review example


{isMarried ? (
<p className="Person__partner">
{`${partnerName} is my ${sex === 'm' ? 'wife' : 'husband'}`}
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 #3: Avoid putting several cases to conditional rendering - create separate variable for the condition. The nested ternary sex === 'm' ? 'wife' : 'husband' is used directly in JSX. Consider creating a separate variable like const partnerLabel = sex === 'm' ? 'wife' : 'husband'; before the return statement and using it in the JSX instead.

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