Skip to content

Solution#3751

Open
Vadym-fe wants to merge 1 commit into
mate-academy:masterfrom
Vadym-fe:develop
Open

Solution#3751
Vadym-fe wants to merge 1 commit into
mate-academy:masterfrom
Vadym-fe:develop

Conversation

@Vadym-fe
Copy link
Copy Markdown

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

The solution is working correctly and meets all functional requirements. However, two style guideline violations should be addressed: (1) Extract the ternary logic for determining partner label into a variable before JSX return; (2) Destructure individual properties from person at the component level for improved readability.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Comment on lines +10 to +11
{person.isMarried
? `${person.partnerName} is my ${person.sex === 'm' ? 'wife' : 'husband'}`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates checklist item #3: 'Avoid putting several cases in conditional rendering. Create separate variable for the condition.' The logic ${person.sex === 'm' ? 'wife' : 'husband'} is embedded directly in the JSX. Consider extracting this to a variable like const partnerLabel = person.sex === 'm' ? 'wife' : 'husband' before the JSX and using it in the template string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants