Skip to content

attemp 1#3910

Open
MaksimShe wants to merge 2 commits into
mate-academy:masterfrom
MaksimShe:develop
Open

attemp 1#3910
MaksimShe wants to merge 2 commits into
mate-academy:masterfrom
MaksimShe:develop

Conversation

@MaksimShe
Copy link
Copy Markdown

No description provided.

@MaksimShe
Copy link
Copy Markdown
Author

DEMO LINK

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

Decision: REQUEST_CHANGES — there is a required checklist violation that must be fixed before approval.

  • Critical issue [CHECKLIST ITEM #2]: In both src/App.jsx (line where the Sum paragraph is rendered via its import) and src/components/Sum/Sum.jsx (the <p> content), the paragraph text is composed using multiple JSX expressions (Sum of {a} and {b} is {a + b}) instead of a single template-string interpolation. This is a required style rule for this task and may cause tests/mentor checks to fail.
  • Why this matters: The checklist explicitly requires a single interpolation inside tag content to standardize output formatting.
  • How to fix: Update the Sum component’s paragraph to use a single template string, e.g., {Sum of ${a} and ${b} is ${a + b}}. Ensure App.jsx continues to render the five Sum instances as-is; no other changes are needed.

Everything else looks solid: named export is correct, defaults for a and b are set, and the five instances in App use numeric props. Once the paragraph is updated to a single interpolation, this should be good 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

Comment thread src/App.jsx
@@ -1,14 +1,13 @@
import React from 'react';
import './App.scss';
import { Sum } from './components/Sum/Sum';
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: "[CODE STYLE] - Use string interpolation inside tag content" (the project checklist requires the paragraph content to be a single template-string). The Sum implementation currently renders the paragraph using multiple JSX expressions: Sum of {a} and {b} is {a + b} which does not match the required single interpolation style. See the Sum source for the current implementation.

Suggested change: produce the paragraph using one template-string expression, for example:

<p>{`Sum of ${a} and ${b} is ${a + b}`}</p>

This keeps the displayed text identical but satisfies checklist item #2. The import on this line brings in the Sum component whose implementation should be updated accordingly.

Comment thread src/components/Sum/Sum.jsx Outdated
// export const Sum = () => ();
export const Sum = ({ a = 0, b = 0 }) => (
<p>
Sum of {a} and {b} is {a + b}
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: "Use string interpolation inside tag content for the paragraph text, e.g., {Sum of ${a} and ${b} is ${a + b}}, rather than concatenating or inserting multiple JSX expressions."

Currently the paragraph uses separate JSX expressions: Sum of {a} and {b} is {a + b}. Replace the paragraph content with a single template string interpolation, for example:

{`Sum of ${a} and ${b} is ${a + b}`}

This will satisfy the checklist requirement and the expected output format.

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

Decision: APPROVE

Your implementation meets the core requirements. The Sum component uses a named export, defaults both a and b to 0, and renders the exact string format using a single template string. In src/App.jsx, you render the five required instances: a=2, b=3; a=-5, b=5; only a=10; only b=5; and no props—each as concise one-line JSX tags. Functionality appears correct and aligns with the checklist and task description.

Minor next steps (non-blocking):

  • Run npm test locally and ensure all tests pass, sharing results if needed.
  • Update your PR description with the live demo link: https://<your_account>.github.io/react_sum/ (replace <your_account> with your GitHub username).

Nice work—clean, minimal, and correct implementation!


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

3 participants