From 00c38cde5a89fc9e4c193366711a19e707e2424f Mon Sep 17 00:00:00 2001 From: sansamiste <127095130+sansamiste@users.noreply.github.com> Date: Fri, 28 Feb 2025 21:24:47 +0200 Subject: [PATCH] solution --- package-lock.json | 9 +++++---- package.json | 2 +- src/App.jsx | 13 ++++++------- src/components/Sum/Sum.jsx | 6 +++++- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index ffe91f1e2..39216a5af 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.0", "@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.0", + "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-2.1.0.tgz", + "integrity": "sha512-o2vuqsP6B3j8ncaDIdRPGLltg2l8MZRRyBkQRDnTRt5XpgE+oSPgW6k0UiDMBbAI3IHNfHNf3ydJPQhPs2aVIw==", "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..c2918e22a 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.0", "@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..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} +

+);