Skip to content

Solution - #3852

Open
nikolamla wants to merge 3 commits into
mate-academy:masterfrom
nikolamla:develop
Open

Solution#3852
nikolamla wants to merge 3 commits into
mate-academy:masterfrom
nikolamla:develop

Conversation

@nikolamla

Copy link
Copy Markdown

No description provided.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

The Person.jsx component has a checklist violation that needs to be addressed. Per [CHECKLIST ITEM #2], the nested ternary ${sex === 'm' ? 'wife' : 'husband'} on line 10 must have each operand on a separate line. The preferred fix is to extract this logic into a separate variable before the return statement: const partnerLabel = sex === 'm' ? 'wife' : 'husband', then use that variable in your template string. This improves readability and meets the style requirements specified in the checklist. Please make this formatting adjustment and resubmit.


✨ 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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/components/Person/Person.jsx Outdated
{age && <p className="Person__age">{`I am ${age}`}</p>}
<p className="Person__partner">
{isMarried
? `${partnerName} is my ${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 nested ternary ${sex === 'm' ? 'wife' : 'husband'} should have each operand on a separate line for better readability. Consider extracting this to a separate variable like const partnerLabel = sex === 'm' ? 'wife' : 'husband' and then using it in the template string.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

The review identified a CHECKLIST ITEM #2 violation in src/App.jsx - the ternary operator on line 3 still has all operands on a single line instead of each on a separate line. Format the ternary like this:

const partnerLabel = sex === 'm' 
  ? 'wife' 
  : 'husband';

While the Person.jsx file has been corrected, App.jsx still needs this formatting fix to satisfy the checklist requirements.


✨ 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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/App.jsx
@@ -1,5 +1,6 @@
import React from 'react';
import './App.scss';
import { Person } from './components/Person/Person';

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 #2: ternary operator operands must be on separate lines. Format as:

const partnerLabel = sex === 'm' 
  ? 'wife' 
  : 'husband';

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your solution is approved. Excellent work implementing the Person component with proper destructuring and conditional rendering. The App.jsx correctly passes entire person objects as props, handles the optional age display for Olya, and properly distinguishes between husband/wife labels. All requirements are met, including the unmarried message display. Keep up the great coding practices!


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

Footnotes

  1. Rate AI review example

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