Skip to content

Implement Sum component Jeverson - #4416

Open
232567 wants to merge 3 commits into
mate-academy:masterfrom
232567:master
Open

Implement Sum component Jeverson #4416
232567 wants to merge 3 commits into
mate-academy:masterfrom
232567:master

Conversation

@232567

@232567 232567 commented Sep 3, 2026

Copy link
Copy Markdown

Olá! A atividade foi concluída conforme solicitado.

Implementei o componente Sum com valores padrão para as props a e b e adicionei os cinco casos solicitados no App.

Todos os testes e o lint estão passando.

DEMO LINK: https://232567.github.io/react_sum/

@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

I am requesting changes because one explicit checklist requirement is not met: using a single template string interpolation inside the tag content. In both src/App.jsx and src/components/Sum/Sum.jsx, the paragraph renders multiple JSX children like Sum of {a} and {b} is {a + b} instead of a single interpolated string, which violates [CHECKLIST ITEM #2]. Please update the <p> content to a single expression using a template literal, for example: {Sum of ${a} and ${b} is ${a + b}}.

What’s done well: the Sum component is a named export, defaults a and b to 0, and App renders all five required cases. This change is small but required by the checklist and style rules. After applying this adjustment, the solution should fully meet the 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
Comment on lines +3 to +4
export function App() {
return (

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. GOOD EXAMPLE:

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

" Your component currently uses JSX expressions separated by text and expressions (Sum of {a} and {b} is {a + b}) instead of a single string interpolation. Consider changing the paragraph content to use a template literal inside a single expression, e.g. {Sum of ${a} and ${b} is ${a + b}} so it matches the required style.

Comment thread src/components/Sum/Sum.jsx Outdated
// export const Sum = () => ();
export function Sum({ a = 0, b = 0 }) {
return (
<p>

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 doesn't follow checklist item #2: "Use string interpolation inside tag content. GOOD EXAMPLE:

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

" Your component currently renders multiple JSX children (Sum of {a} and {b} is {a + b}) instead of a single interpolated string. Consider replacing the contents with a template string inside braces.

@232567

232567 commented Sep 3, 2026

Copy link
Copy Markdown
Author

Olá! Corrigi o componente Sum para usar uma única interpolação de string com template literal, conforme solicitado no checklist. Os testes e o lint estão passando. Obrigado!

@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 implementation fully satisfies all requirements. The Sum component correctly uses a named export, defaults props to 0, and renders the sum using template literal interpolation in the specified format. The App component properly renders all five required test cases, and all component tags with fewer than 3 attributes are written on single lines as required. No critical issues or blockers were identified.


✨ 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