added solution#3796
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am requesting changes because there are still critical issues that block the task from fully meeting the requirements and passing the tests. First, in src/components/Person/Person.jsx the partner span uses the class Pesron__partner instead of the required Person__partner, so the tests looking for .Person__partner fail and the markup does not match the specification. Second, the inline ternary sex === 'f' ? 'husband' : 'wife' is formatted on a single line, which violates the explicit checklist rule to put each ternary operand on its own line [CHECKLIST ITEM #2]; this is a required style constraint for the task, not just a preference. To fix things, change the typo in the class name to exactly Person__partner everywhere you render the partner, and reformat the ternary like:
const partnerRole = sex === 'f'
? 'husband'
: 'wife';Functionally, your component behavior (passing the whole person object, conditional age, married vs not married, husband/wife wording) is otherwise solid, so once you correct the class name and ternary formatting, your solution should be in good shape. Keep going—these are small but important corrections and you’re very close to a complete solution.
✨ 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
| <h2 className="Person__name">My name is {name}</h2> | ||
| {age && <p className="Person__age">I am {age}</p>} | ||
| {isMarried ? ( | ||
| <span className="Pesron__partner"> |
There was a problem hiding this comment.
This span uses Pesron__partner instead of Person__partner, which violates the requirement: "Ensure that the class names in Person.jsx match those used in App.jsx (Person, Person__name, Person__age, Person__partner)."
| {age && <p className="Person__age">I am {age}</p>} | ||
| {isMarried ? ( | ||
| <span className="Pesron__partner"> | ||
| {partnerName} is my {sex === 'f' ? 'husband' : 'wife'} |
There was a problem hiding this comment.
This inline ternary sex === 'f' ? 'husband' : 'wife' matches the "BAD EXAMPLE" pattern from checklist item #2: "Format ternary operator operands correctly - move each operand to the separate line." Consider rewriting it over multiple lines.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution is approved because it fully implements the required Person component behavior and its usage in App. The Person component correctly receives the whole person object as a prop, destructures it, and conditionally renders the age only when it exists, matching the task description. Married status is handled properly: an unmarried person shows “I am not married”, and for married people you correctly switch between husband and wife based on the sex field. The class names (Person, Person__name, Person__age, Person__partner) are all aligned with the specification, including the previously fixed partner span class. Checklist requirements such as props destructuring and formatting the ternary operator across multiple lines are satisfied, and there are no functional blockers or missing features in the current implementation. Nicely done keeping the constants (misha, olya, alex) unchanged and wiring them cleanly into the three Person usages in App. Overall, this meets both the functional and style expectations for the task.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.