Skip to content

solution#3766

Open
SkepskyiDanylo wants to merge 1 commit into
mate-academy:masterfrom
SkepskyiDanylo:dev
Open

solution#3766
SkepskyiDanylo wants to merge 1 commit into
mate-academy:masterfrom
SkepskyiDanylo:dev

Conversation

@SkepskyiDanylo
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

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

  1. Rate AI review example

Comment thread src/App.jsx
import './App.scss';
import { Person } from './components/Person/Person';

export const misha = {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 ? ... : ...}

Comment on lines +5 to +6
{person.isMarried ? (
<p className="Person__partner">{`${person.partnerName} is my ${person.sex === 'f' ? 'husband' : 'wife'}`}</p>
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 #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.

Comment on lines +5 to +9
{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>
)}
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: 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.

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