Solution - #3852
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
The Person.jsx component has a checklist violation that needs to be addressed. Per [CHECKLIST ITEM #2], the nested ternary ${sex === 'm' ? 'wife' : 'husband'} on line 10 must have each operand on a separate line. The preferred fix is to extract this logic into a separate variable before the return statement: const partnerLabel = sex === 'm' ? 'wife' : 'husband', then use that variable in your template string. This improves readability and meets the style requirements specified in the checklist. Please make this formatting adjustment and resubmit.
✨ 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
| {age && <p className="Person__age">{`I am ${age}`}</p>} | ||
| <p className="Person__partner"> | ||
| {isMarried | ||
| ? `${partnerName} is my ${sex === 'm' ? 'wife' : 'husband'}` |
There was a problem hiding this comment.
Checklist item #2 violation: The nested ternary ${sex === 'm' ? 'wife' : 'husband'} should have each operand on a separate line for better readability. Consider extracting this to a separate variable like const partnerLabel = sex === 'm' ? 'wife' : 'husband' and then using it in the template string.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
The review identified a CHECKLIST ITEM #2 violation in src/App.jsx - the ternary operator on line 3 still has all operands on a single line instead of each on a separate line. Format the ternary like this:
const partnerLabel = sex === 'm'
? 'wife'
: 'husband';While the Person.jsx file has been corrected, App.jsx still needs this formatting fix to satisfy the checklist requirements.
✨ 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
| @@ -1,5 +1,6 @@ | |||
| import React from 'react'; | |||
| import './App.scss'; | |||
| import { Person } from './components/Person/Person'; | |||
There was a problem hiding this comment.
This violates CHECKLIST ITEM #2: ternary operator operands must be on separate lines. Format as:
const partnerLabel = sex === 'm'
? 'wife'
: 'husband';
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution is approved. Excellent work implementing the Person component with proper destructuring and conditional rendering. The App.jsx correctly passes entire person objects as props, handles the optional age display for Olya, and properly distinguishes between husband/wife labels. All requirements are met, including the unmarried message display. Keep up the great coding practices!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.