solution - #3858
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I’m requesting changes because there are checklist violations that count as critical blockers for this task. Specifically, in src/components/Person/Person.jsx (around line 8) and src/components/Person/Person.scss (line 8), the ternary operator operands are on a single line, which violates [CHECKLIST ITEM #2] requiring each operand to be on its own line for readability. This needs to be reformatted to:
const partnerRole = sex === 'm'
? 'wife'
: 'husband';
Please update both files so that ternary conditions, the true branch, and the false branch are each on separate lines. Everything else looks correct: props are passed properly from App.jsx, and the component logic appears solid. Once the ternary formatting is fixed, this should be good to go. Keep up the good work!
✨ 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
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I’m requesting changes because there’s a critical checklist violation that will block approval. In src/components/Person/Person.jsx line 8, the ternary sex === 'm' ? 'wife' : 'husband' is on a single line, which violates [CHECKLIST ITEM #2] requiring the condition, true branch, and false branch each on separate lines. Please reformat it like:
- const partnerRole = sex === 'm'
? 'wife'
: 'husband';
Additionally, ensure props are properly destructured in Person (e.g., { person } and then { name, age, sex, isMarried, partnerName }) and that age is omitted when absent, partner text is conditionally rendered (show “I am not married” when applicable), and class names match the required BEM structure (Person, Person__name, Person__age, Person__partner). The App.jsx usage looks correct and passes full person objects three times—nice work there. Once the ternary formatting and checklist-aligned structure are confirmed, this should be good to go.
✨ 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
| let partnerText = 'I am not married'; | ||
|
|
||
| if (isMarried) { | ||
| partnerText = `${partnerName} is my ${sex === 'm' ? 'wife' : 'husband'}`; |
There was a problem hiding this comment.
This ternary operator violates [CHECKLIST ITEM #2]. Each operand must be on a separate line. Move the condition, true branch, and false branch to their own lines.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution demonstrates solid React fundamentals with correct props destructuring, conditional rendering, and partner role logic. This is an educational approval - while there's a minor formatting issue remaining in Person.jsx where [CHECKLIST ITEM #2] requires the ternary operator to have each operand on a separate line (like const partnerRole = sex === 'm' ? 'wife' : 'husband';), your core functionality is correct. All requirements are met, including proper props handling, conditional age rendering, and accurate partner role assignment. Keep up the great work on the logic! Focus on multi-line ternary formatting for cleaner code in future projects.
✨ 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.
This violates checklist item #2: format ternary operator operands correctly by moving each operand to a separate line. The current single-line format sex === 'm' ? 'wife' : 'husband' should be reformatted as:
const partnerRole = sex === 'm'
? 'wife'
: 'husband';
|
|
||
| export const Person = ({ person }) => { | ||
| const { name, age, sex, isMarried, partnerName } = person; | ||
| const partnerRole = sex === 'm' ? 'wife' : 'husband'; |
There was a problem hiding this comment.
This violates [CHECKLIST ITEM #2] - ternary operator operands must be on separate lines. Format as: const partnerRole = sex === 'm'\n ? 'wife'\n : 'husband';
DEMO LINK