Skip to content

Sollution 1#3755

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

Sollution 1#3755
YaroslavKra wants to merge 1 commit into
mate-academy:masterfrom
YaroslavKra:develop

Conversation

@YaroslavKra
Copy link
Copy Markdown

No description provided.

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

Your solution correctly implements all functional requirements from the task. The component properly renders person's details, handles conditional rendering for married/unmarried status, correctly displays 'wife' or 'husband' based on sex, and the Person component is used three times in App.jsx as specified. All checklist items related to functionality are satisfied. The flagged issues—nested property destructuring and ternary operator formatting—are code style improvements rather than functional blockers. These will be addressed through linter feedback, which you should apply to improve code consistency.


✨ 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 +1 to +11
export const Person = ({ person }) => (
<section className="Person">
<h2 className="Person__name">My name is {person.name}</h2>
{person.age && <p className="Person__age">I am {person.age}</p>}
{person.isMarried && (
<p className="Person__partner">
{person.partnerName} is my {person.sex === 'm' ? 'wife' : 'husband'}
</p>
)}
{!person.isMarried && <p className="Person__partner">I am not married</p>}
</section>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: While person is destructured from props, the nested properties (age, isMarried, sex, partnerName) are accessed directly without destructuring. Consider destructuring them as well: const { name, age, isMarried, sex, partnerName } = person;

{person.age && <p className="Person__age">I am {person.age}</p>}
{person.isMarried && (
<p className="Person__partner">
{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.

Checklist item #2 violation: The ternary operator should have each operand on a separate line for readability. Current: {person.sex === 'm' ? 'wife' : 'husband'} should be formatted with the condition, true value, and false value each on their own lines.

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