From 3db05fc730f9abf60f94087f5ae8eeff4c17890e Mon Sep 17 00:00:00 2001 From: yevkrasnenkov Date: Fri, 10 Apr 2026 20:48:20 -0400 Subject: [PATCH 1/6] sum props --- README.md | 2 +- package-lock.json | 9 +++++---- package.json | 2 +- src/App.jsx | 13 ++++++------- src/components/Sum/Sum.jsx | 6 +++++- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 03eb3e57a..e670d8ca6 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://mate-tasks.github.io/react_sum/) and add it to the PR description. diff --git a/package-lock.json b/package-lock.json index ffe91f1e2..53b982878 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@cypress/react18": "^2.0.1", - "@mate-academy/scripts": "^1.8.5", + "@mate-academy/scripts": "^2.1.3", "@mate-academy/stylelint-config": "*", "@vitejs/plugin-react": "^4.3.1", "cypress": "^13.13.0", @@ -763,10 +763,11 @@ } }, "node_modules/@mate-academy/scripts": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-1.8.5.tgz", - "integrity": "sha512-mHRY2FkuoYCf5U0ahIukkaRo5LSZsxrTSgMJheFoyf3VXsTvfM9OfWcZIDIDB521kdPrScHHnRp+JRNjCfUO5A==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-2.1.3.tgz", + "integrity": "sha512-a07wHTj/1QUK2Aac5zHad+sGw4rIvcNl5lJmJpAD7OxeSbnCdyI6RXUHwXhjF5MaVo9YHrJ0xVahyERS2IIyBQ==", "dev": true, + "license": "MIT", "dependencies": { "@octokit/rest": "^17.11.2", "@types/get-port": "^4.2.0", diff --git a/package.json b/package.json index 863c49669..f41ce178d 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ }, "devDependencies": { "@cypress/react18": "^2.0.1", - "@mate-academy/scripts": "^1.8.5", + "@mate-academy/scripts": "^2.1.3", "@mate-academy/stylelint-config": "*", "@vitejs/plugin-react": "^4.3.1", "cypress": "^13.13.0", diff --git a/src/App.jsx b/src/App.jsx index dc51f769d..5a2d5c416 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 5b25dc8886830843860c9c739b45318643129278 Mon Sep 17 00:00:00 2001 From: yevkrasnenkov Date: Fri, 10 Apr 2026 20:57:05 -0400 Subject: [PATCH 2/6] omit values 0 --- src/App.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 5a2d5c416..708add0a8 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -6,8 +6,8 @@ export const App = () => ( <> - - - + + + ); From 893df86caee9fdf79df7444cf5a4f68c4b92a2b4 Mon Sep 17 00:00:00 2001 From: yevkrasnenkov Date: Fri, 10 Apr 2026 20:59:46 -0400 Subject: [PATCH 3/6] exclude interpolation --- 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 6f440b4a01a2b496afb334efde7059db9754c29b Mon Sep 17 00:00:00 2001 From: yevkrasnenkov Date: Fri, 10 Apr 2026 21:04:27 -0400 Subject: [PATCH 4/6] revert $ --- 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 1e5bd28b2..f06972209 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 a3e5e366b4671672a8776c0073dd07baedf9ccef Mon Sep 17 00:00:00 2001 From: yevkrasnenkov Date: Fri, 10 Apr 2026 21:13:20 -0400 Subject: [PATCH 5/6] check this --- src/App.jsx | 20 +++++++++++++++----- src/components/Sum/Sum.jsx | 4 +--- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 708add0a8..b47feabca 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -4,10 +4,20 @@ import { Sum } from './components/Sum/Sum'; export const App = () => ( <> - - - - - + + + + + ); diff --git a/src/components/Sum/Sum.jsx b/src/components/Sum/Sum.jsx index f06972209..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}`}

); From ab68e44eed32c8fc3765e8427184ec245e3d1f8f Mon Sep 17 00:00:00 2001 From: yevkrasnenkov Date: Fri, 10 Apr 2026 21:13:37 -0400 Subject: [PATCH 6/6] hey --- src/App.jsx | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index b47feabca..708add0a8 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -4,20 +4,10 @@ import { Sum } from './components/Sum/Sum'; export const App = () => ( <> - - - - - + + + + + );