From 731e419ece8f68ba2cdb7c9b53e3a103083be25f Mon Sep 17 00:00:00 2001 From: ebfidKate Date: Sun, 10 Dec 2023 18:45:33 +0000 Subject: [PATCH] added solution --- README.md | 2 +- package-lock.json | 9 ++++----- src/App.jsx | 23 ++++++++++++++++------- src/components/Sum/Sum.jsx | 4 +++- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 4ff72fdd7..8cf72114a 100644 --- a/README.md +++ b/README.md @@ -17,4 +17,4 @@ The `App` should contain the next `Sum` components: - 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://ebfidKate.github.io/react_sum/) and add it to the PR description. diff --git a/package-lock.json b/package-lock.json index 493f8fecb..7560e6601 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4404,17 +4404,16 @@ } }, "@mate-academy/eslint-config-react-typescript": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@mate-academy/eslint-config-react-typescript/-/eslint-config-react-typescript-1.0.1.tgz", - "integrity": "sha512-w/RCq4SUvKv7M6BUrvN8y/Br0kuI7LE95mG68U4xJRt2L43AKw1Yoy6LNlxV8fTOnzL0VDwzUn+GXvcrNfKmrw==", + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/@mate-academy/eslint-config-react-typescript/-/eslint-config-react-typescript-1.0.13.tgz", + "integrity": "sha512-RCGosAEa2Bcpiz5F3Ogvnpod22KBf4P+J9PiRS60F+zAPnB8xDwS9F09MtCSuggiJnVlLNxKuKXMz2L+Is9s3A==", "dev": true, "requires": { - "@typescript-eslint/eslint-plugin": "^4.29.0", "@typescript-eslint/parser": "^4.29.0", "eslint-config-airbnb-typescript": "^12.3.1", "eslint-plugin-import": "^2.23.4", "eslint-plugin-jsx-a11y": "^6.4.1", - "eslint-plugin-react": "^7.29.4", + "eslint-plugin-react": "^7.27.1", "eslint-plugin-react-hooks": "^4.2.0" } }, diff --git a/src/App.jsx b/src/App.jsx index dc51f769d..6ff7b6ac2 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,14 +1,23 @@ 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..ba3ca8cdd 100644 --- a/src/components/Sum/Sum.jsx +++ b/src/components/Sum/Sum.jsx @@ -1 +1,3 @@ -// export const Sum = () => (); +export const Sum = ({ a = 0, b = 0 }) => ( +

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

+);