From 046ad9b236182d5e6442c356fc9ee2eac1960979 Mon Sep 17 00:00:00 2001 From: Petrenko Oleksii Date: Fri, 21 Aug 2026 23:03:29 +0300 Subject: [PATCH 1/3] sum-component --- README.md | 2 +- src/App.jsx | 13 ++++++------- src/components/Sum/Sum.jsx | 6 +++++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 03eb3e57a..b892418a0 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,4 @@ The `App` should contain the next `Sum` components: - Install Prettier Extention and use this [VSCode settings](https://mate-academy.github.io/fe-program/tools/vscode/settings.json) to enable format on save. - Implement a solution following the [React task guideline](https://github.com/mate-academy/react_task-guideline#react-tasks-guideline). - Open one more terminal and run tests with `npm test` to ensure your solution is correct. -- Replace `` with your Github username in the [DEMO LINK](https://.github.io/react_sum/) and add it to the PR description. +- Replace `` with your Github username in the [DEMO LINK](https://petrenko1694-spec.github.io/react_sum/) and add it to the PR description. diff --git a/src/App.jsx b/src/App.jsx index dc51f769d..708add0a8 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,14 +1,13 @@ import React from 'react'; import './App.scss'; +import { Sum } from './components/Sum/Sum'; export const App = () => ( <> -

Sum of 2 and 3 is 5

-

Sum of -5 and 5 is 0

-

Sum of 10 and 0 is 10

-

Sum of 0 and 5 is 5

-

Sum of 0 and 0 is 0

- {/* Replace paragraphs with Sum componets */} - {/* And remove commented lines :) */} + + + + + ); diff --git a/src/components/Sum/Sum.jsx b/src/components/Sum/Sum.jsx index 381aa0422..f06972209 100644 --- a/src/components/Sum/Sum.jsx +++ b/src/components/Sum/Sum.jsx @@ -1 +1,5 @@ -// export const Sum = () => (); +export const Sum = ({ a = 0, b = 0 }) => ( +

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

+); From 434bf6b6f132f81ef5cf95f54d1aa506b63bb515 Mon Sep 17 00:00:00 2001 From: Petrenko Oleksii Date: Fri, 21 Aug 2026 23:09:38 +0300 Subject: [PATCH 2/3] sum-component --- src/components/Sum/Sum.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Sum/Sum.jsx b/src/components/Sum/Sum.jsx index f06972209..1e5bd28b2 100644 --- a/src/components/Sum/Sum.jsx +++ b/src/components/Sum/Sum.jsx @@ -1,5 +1,5 @@ export const Sum = ({ a = 0, b = 0 }) => (

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

); From 76ea7ba54ae35090f93812fe3f8453df15b3ec3d Mon Sep 17 00:00:00 2001 From: Petrenko Oleksii Date: Fri, 21 Aug 2026 23:13:43 +0300 Subject: [PATCH 3/3] sum-component --- src/components/Sum/Sum.jsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/Sum/Sum.jsx b/src/components/Sum/Sum.jsx index 1e5bd28b2..ba3ca8cdd 100644 --- a/src/components/Sum/Sum.jsx +++ b/src/components/Sum/Sum.jsx @@ -1,5 +1,3 @@ export const Sum = ({ a = 0, b = 0 }) => ( -

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

+

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

);