react-person#3802
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am approving your solution because all functional requirements are correctly implemented: the Person component renders the right markup, is used three times in App, receives the whole person object as a prop, handles optional age, and correctly shows marriage status and partner wording for both sexes. The only issue identified is a style / checklist point around ternary formatting for partnerSex in both src/App.jsx and src/components/Person/Person.jsx [CHECKLIST ITEM #2], where the condition, ? branch, and : branch should each be on their own line. This is important for readability, but it does not break functionality or the task’s core requirements, so it is not a blocker. When you revisit the code, you can fix it by rewriting it in the form:
const partnerSex = person.sex === 'f'
? 'husband'
: 'wife';Overall, your implementation is solid and aligned with the task; just keep an eye on these formatting details in future tasks to stay consistent with the checklist.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| @@ -1,5 +1,6 @@ | |||
| import React from 'react'; | |||
| import './App.scss'; | |||
There was a problem hiding this comment.
This violates checklist item #2: Readabily is everything. Format ternary operator operands correctly - move each operand to the separate line. Here the ternary for partnerSex is on one line; update it so the condition, ? branch, and : branch are each on their own lines.
| @@ -1 +1,14 @@ | |||
| // export const Person = ({ person }) => (); | |||
| export const Person = ({ person }) => { | |||
| const partnerSex = person.sex === 'f' ? 'husband' : 'wife'; | |||
There was a problem hiding this comment.
This violates checklist item #2: "Readabily is everything. Format ternary operator operands correctly – move each operand to the separate line". Your partnerSex assignment uses the bad example pattern (condition ? firstValue : secondValue) instead of:
const partnerSex = person.sex === 'f'
? 'husband'
: 'wife';
DEMO LINK