Skip to content

done#3645

Open
eduferrs wants to merge 5 commits intomate-academy:masterfrom
eduferrs:master
Open

done#3645
eduferrs wants to merge 5 commits intomate-academy:masterfrom
eduferrs:master

Conversation

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

Great job on the implementation! The component works correctly and meets all the functional requirements. However, a couple of changes are needed to align the code with the project's style guidelines before this can be approved.

Specifically, in src/components/Person/Person.jsx:

  1. Destructuring: Please destructure the properties from the person object (e.g., const { name, age } = person;) at the beginning of the component to improve readability, as required by the checklist. [CHECKLIST ITEM #1]
  2. Ternary Formatting: The ternary operator used for the partner's title should be formatted across multiple lines, with each operand on its own line. This is a mandatory style rule. [CHECKLIST ITEM #2]

Once these style adjustments are made, your solution will be perfect. Looking forward to seeing the update!


✨ 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

@@ -1 +1,15 @@
// export const Person = ({ person }) => ();
export const 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.

To improve readability, consider destructuring the person object to directly access its properties (name, age, sex, etc.) within the component. This would avoid repetitive prefixes like person.name and aligns with the principle shown in checklist item #1: 'Use destructuring for getting access to values of props object'.

For example:

export const Person = ({ person }) => {
  const { name, age, isMarried, partnerName, sex } = person;

  return (
    // ... use name, age, etc. directly
  );
};


{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.

This violates checklist item #2: 'Format ternary operator operands correctly - move each operand to the separate line'. For better readability, this nested ternary operator should be formatted across multiple lines.

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

Great progress on this PR! You've correctly implemented the destructuring, which has really improved the component's readability. We're very close to merging this.

The only remaining issue is a mandatory code style violation in src/components/Person/Person.jsx. The ternary operator used to determine the partner's title must be formatted across multiple lines, with each operand on its own line, as required by [CHECKLIST ITEM #2].

Please make that one adjustment, and this will be ready 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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example


{isMarried ? (
<p className="Person__partner">
{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.

This ternary operator still needs to be formatted according to the project's style guide. As per checklist item #2, please move each operand to a new line to improve readability.

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

I am approving this solution as an educational override to help you progress, but please review the feedback for future tasks. Great work on the component logic and props handling—everything functions correctly!

The one remaining issue is a code style violation in src/components/Person/Person.jsx. The nested ternary operator on line 13 needs to be formatted across multiple lines to improve readability, as required by the style guide [CHECKLIST ITEM #2].

Here’s how it should look:

const partnerTitle = isMarried
  ? gender === 'male'
    ? 'wife'
    : 'husband'
  : 'I am not married';

Applying this formatting makes your code much easier to read and maintain. Keep up the excellent effort!


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

Footnotes

  1. Rate AI review example

{isMarried
? (
<p className="Person__partner">
{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.

This nested ternary operator still violates the code style rule from checklist item #2. For better readability, please format it by moving each operand to a new line.

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