Skip to content

Solution#3759

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

Solution#3759
GoatSpirit wants to merge 1 commit into
mate-academy:masterfrom
GoatSpirit:develop

Conversation

@GoatSpirit
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 successfully meets all core functional requirements. The Person component correctly destructures the person prop, conditionally renders the age field when present, handles the wife/husband terminology properly based on sex, and displays the correct married/not married messages for all three instances in App.jsx. All required class names match the specification. Regarding the checklist violations flagged: the nested ternary expression for determining partner label and the ternary operand formatting are style concerns rather than functional blockers. These are the types of issues typically caught by linters like ESLint or Prettier. Since your code functions correctly and all requirements are implemented, I'll approve this submission. However, I'd encourage you to address these style points going forward: extract ${sex === 'm' ? 'wife' : 'husband'} into a const partnerLabel variable before the return statement, and ensure ternary operands occupy their own lines for better readability [CHECKLIST ITEMS #2 and #3]. This practice improves code maintainability, especially as your components grow in complexity.


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

Footnotes

  1. Rate AI review example


<p className="Person__partner">
{isMarried
? `${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'} should be extracted to a variable like const partnerLabel = sex === 'm' ? 'wife' : 'husband'; before the return statement.

Comment on lines +24 to +26
{isMarried
? `${partnerName} is my ${sex === 'm' ? 'wife' : 'husband'}`
: 'I am not married'}
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 #2: 'Format ternary operator operands correctly - move each operand to the separate line.' Each operand of the ternary should be on its own line for better readability.

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