Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

done1 #3453

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

done1 #3453

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 211 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
"license": "GPL-3.0",
"dependencies": {
"@fortawesome/fontawesome-free": "^6.5.2",
"@rollup/rollup-win32-x64-msvc": "^4.34.9",
"bulma": "^1.0.1",
"classnames": "^2.5.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"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",
Expand Down
8 changes: 6 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import './App.scss';
import { Sum } from './components/Sum/Sum';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Sum component is imported correctly, but the App component should include multiple Sum components with different prop values as specified in the task description. Currently, only one Sum component is used with a={2} and b={2}. You need to add the following Sum components:

  • a = 2 and b = 3
  • a = -5 and b = 5
  • just a = 10
  • just b = 5
  • no params at all.


export const App = () => (
<>
Expand All @@ -8,7 +9,10 @@ export const App = () => (
<p>Sum of 10 and 0 is 10</p>
<p>Sum of 0 and 5 is 5</p>
<p>Sum of 0 and 0 is 0</p>
{/* Replace paragraphs with Sum componets */}
{/* And remove commented lines :) */}
<Sum a={2} b={3} />
<Sum a={-5} b={5} />
<Sum a={10} b={0} />
<Sum a={0} b={5} />
<Sum a={0} b={0} />
</>
);
6 changes: 5 additions & 1 deletion src/components/Sum/Sum.jsx
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
// export const Sum = () => ();
export const Sum = ({ a = 0, b = 0 }) => (
<p>
Sum of {a} and {b} is {a + b}
</p>
);
Loading