Skip to content

add task solution#3740

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

add task solution#3740
Roma-Yamshchikov wants to merge 1 commit into
mate-academy:masterfrom
Roma-Yamshchikov:develop

Conversation

@Roma-Yamshchikov
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 correctly handles all functional requirements—the conditional age display, gender-aware partner naming, and marriage status messages all work as expected. However, there are three explicit checklist violations that need to be addressed: [CHECKLIST ITEM #1] In src/components/Person/Person.jsx, you're destructuring person from props but then accessing properties as person.name, person.age, etc. Instead, destructure all properties directly: const { name, age, sex, isMarried, partnerName } = person; [CHECKLIST ITEM #2] The ternary operator operands must be on separate lines for readability—format the condition, truthy value, and falsy value each on their own line. [CHECKLIST ITEM #3] Avoid nested ternary operators in JSX. Create a separate variable (e.g., const partnerLabel = sex === 'm' ? 'husband' : 'wife';) before the return statement and use that variable instead. The same destructuring issue exists in src/App.jsx. Once these checklist items are addressed, your solution will be complete.


✨ 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';
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 #1: Use destructuring for getting access to values of props object. The component should destructure all properties from the person object (name, age, isMarried, partnerName, sex) rather than accessing them via person.xxx throughout the component.

@@ -1 +1,11 @@
// 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.

Checklist item #1 violation: Use destructuring for accessing individual values. Destructure name, age, sex, isMarried, partnerName directly from props instead of accessing through person object. See the GOOD examples in checklist for the expected pattern.

Comment on lines +6 to +7
{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.

Checklist item #2 violation: Ternary operands must be on separate lines for readability. The condition and each operand should be on its own line.

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

Checklist item #3 violation: Avoid nested ternary operators and multiple cases in conditional rendering. Create a separate variable for the partner label (wife or husband) before the return statement.

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

This solution requires changes before it can be approved. There are 2 critical issues that need fixing:

  1. CHECKLIST VIOLATIONS (3 items): The code still has all 3 checklist violations from the previous review. In Person.jsx, you need to: (1) destructure name, age, sex, isMarried, partnerName from the person prop directly instead of accessing person.name etc.; (2) move ternary operands to separate lines with proper indentation; (3) extract the partner label (wife/husband) to a variable like const partnerLabel = sex === 'm' ? 'husband' : 'wife'; before the return statement instead of using a nested ternary in JSX.

  2. TEST FAILURES: Two Cypress component tests are failing because your component outputs improper whitespace. The tests expect 'Natasha is my wife' but get 'Natasha is my\n wife' - this indicates your JSX text spans multiple lines or has incorrect interpolation formatting. Fix the partner relationship text to render as a clean single-line string on one line in your JSX.

These are critical blockers that prevent the task from being considered complete. Please address all checklist items and ensure your component produces clean text output.


✨ 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,12 @@
// 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.

[CHECKLIST ITEM #1] Instead of accessing person.name, person.age, etc., destructure the properties from person directly: const { name, age, sex, isMarried, partnerName } = person;

Comment thread src/components/Person/Person.jsx Outdated
Comment on lines +6 to +8
{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.

[CHECKLIST ITEM #3] Avoid nested ternary inside the template string. Create a separate variable before the return: const partnerLabel = sex === 'm' ? 'wife' : 'husband'; and use it in the template.

Comment on lines +6 to +9
{person.isMarried
? `${person.partnerName} is my
${person.sex === 'm' ? 'wife' : 'husband'}`
: 'I am not married'}
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] Format ternary operands correctly - move each operand to a separate line with proper indentation.

Comment thread src/App.jsx
@@ -1,5 +1,6 @@
import React from 'react';
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] This destructures only person and then accesses properties as person.name, person.age, etc. Instead, destructure all properties directly from props: export const Person = ({ name, age, sex, isMarried, partnerName }) => (

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.

[CHECKLIST ITEM #1] Use destructured name instead of person.name

Comment thread src/App.jsx
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.

[CHECKLIST ITEM #1] Use destructured age instead of person.age

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.

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]

If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.

Copy link
Copy Markdown

@Anton-Kuchmasov Anton-Kuchmasov left a comment

Choose a reason for hiding this comment

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

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.

3 participants