From b858d3812445ec7ccabd0b551ef281fac3a06e60 Mon Sep 17 00:00:00 2001 From: IURII FEDYNA Date: Thu, 20 Feb 2025 17:15:00 -0330 Subject: [PATCH] add task solution --- src/App.jsx | 23 ++++++++++++----------- src/components/Sum/Sum.jsx | 6 +++++- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index dc51f769d..4aed76551 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,14 +1,15 @@ 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 :) */} - -); +export function App() { + return ( +
+ + + + + +
+ ); +} diff --git a/src/components/Sum/Sum.jsx b/src/components/Sum/Sum.jsx index 381aa0422..57fa39fcf 100644 --- a/src/components/Sum/Sum.jsx +++ b/src/components/Sum/Sum.jsx @@ -1 +1,5 @@ -// export const Sum = () => (); +import React from "react"; + +export function Sum({ a = 0, b = 0 }) { + return

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

; +}