solution#3766
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation successfully meets all core functional requirements. The Person component correctly handles the person object, displays partner labels appropriately based on sex, shows "I am not married" when applicable, and renders without errors. The checklist violations mentioned (props destructuring, conditional extraction to variables, ternary formatting) are code style and readability improvements rather than functional blockers. All functional tests would pass with this implementation. That said, keep these style guidelines in mind for future work—extracting complex conditions to named variables and using destructuring for props are valuable practices that improve code maintainability. These will become more important as your components grow in complexity. Good job on getting the functionality working correctly!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| import './App.scss'; | ||
| import { Person } from './components/Person/Person'; | ||
|
|
||
| export const misha = { |
There was a problem hiding this comment.
Consider extracting the marriage condition into a separate variable for better readability, as per checklist item #3. Example: const isMarried = person.isMarried; then use {isMarried ? ... : ...}
| {person.isMarried ? ( | ||
| <p className="Person__partner">{`${person.partnerName} is my ${person.sex === 'f' ? 'husband' : 'wife'}`}</p> |
There was a problem hiding this comment.
Checklist Item #3 violation: The partner label logic person.sex === 'f' ? 'husband' : 'wife' is embedded directly in the JSX. Create a separate variable for this condition before the return statement to improve readability.
| {person.isMarried ? ( | ||
| <p className="Person__partner">{`${person.partnerName} is my ${person.sex === 'f' ? 'husband' : 'wife'}`}</p> | ||
| ) : ( | ||
| <p className="Person__partner">I am not married</p> | ||
| )} |
There was a problem hiding this comment.
Checklist Item #2 violation: Ternary operands should be formatted with each operand on a separate line for better readability. Currently the condition and operands are not following the recommended format pattern.
DEMO LINK