Skip to content

Commit

Permalink
done task
Browse files Browse the repository at this point in the history
  • Loading branch information
Iwantschenko committed Mar 3, 2025
1 parent dbb5c23 commit 96cc264
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<your_account>` with your Github username in the [DEMO LINK](https://<your_account>.github.io/react_sum/) and add it to the PR description.
- Replace `<your_account>` with your Github username in the [DEMO LINK](https://Iwantschenko.github.io/react_sum/) and add it to the PR description.
14 changes: 7 additions & 7 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react';
import './App.scss';

import { Sum } from './components/Sum/Sum';

export const App = () => (
<>
<p>Sum of 2 and 3 is 5</p>
<p>Sum of -5 and 5 is 0</p>
<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} />
<Sum a={5} />
<Sum />
</>
);
8 changes: 7 additions & 1 deletion src/components/Sum/Sum.jsx
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
// export const Sum = () => ();
export const Sum = ({ a = 0, b = 0 }) => {
return (
<p>
Sum of {a} and {b} is {a + b}
</p>
);
};

0 comments on commit 96cc264

Please sign in to comment.