Skip to content

Develop#3724

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

Develop#3724
KaramushkoAndrii wants to merge 3 commits into
mate-academy:masterfrom
KaramushkoAndrii:develop

Conversation

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

The component has a critical test failure. The Person component is only rendering the raw name ('Misha') instead of the expected formatted output ('My name is Misha'). Both cypress/integration/page.spec.js and src/Person.spec.jsx are failing because of this. To fix this, update the Person component to display the name with the proper prefix. Instead of just {name}, use My name is {name} or the appropriate format based on the task requirements. There are also two code style violations to address: [CHECKLIST ITEM #2] the ternary operator in App.jsx should have each operand on its own line, and [CHECKLIST ITEM #3] the sex === 'm' ? 'wife' : 'husband' logic in Person.jsx should be extracted to a separate variable like const partnerLabel before the return statement.


✨ 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>}
{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 violates checklist item #3: 'Avoid putting several cases to conditional rendering. Create separate variable for the condition.' The sex === 'm' ? 'wife' : 'husband' logic is embedded directly in JSX. Extract this to a variable like const partnerLabel = sex === 'm' ? 'wife' : '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

All core functionality is working correctly—the Person component properly displays details, conditionally renders age and partner information, uses destructuring for props, and the critical name formatting issue is fixed. The only remaining issue is a formatting violation in CHECKLIST ITEM #2. In both src/components/Person/Person.jsx and src/App.jsx, the ternary operator operands should each be on a separate line for readability. For example, the code in Person.jsx line 5 should be reformatted to: jsx const second = sex === 'm' ? 'wife' : 'husband'; This is a minor style issue that doesn't affect functionality—your implementation passes all requirements. Keep up the good work on getting the logic right!


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

Footnotes

  1. Rate AI review example

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

const second = 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. Format it as:

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

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.

CHECKLIST ITEM #2 violation: Format ternary operator operands correctly - move each operand to the separate line. Current: const second = sex === 'm' ? 'wife' : 'husband'; Should be:

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

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