From 6d619c8caa641e18a48f84e19bf9272e12a4e047 Mon Sep 17 00:00:00 2001 From: Savy Date: Wed, 5 Apr 2023 16:03:00 +0530 Subject: [PATCH] Finished Ex 1.9 thru 1.11 --- Part_1/unicafe/src/App.js | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/Part_1/unicafe/src/App.js b/Part_1/unicafe/src/App.js index 23f2705..17803c4 100644 --- a/Part_1/unicafe/src/App.js +++ b/Part_1/unicafe/src/App.js @@ -10,9 +10,29 @@ const Button = ({ handleClick, text }) => { const StatsDisplay = (props) => { return ( - <> -

{props.text}: {props.value}{props.sign}

- + + {props.text} + {props.value}{props.sign} + + ) +} + +const Stats = (props) => { + if (props.good === 0 && props.neutral === 0 && props.bad === 0) { + return ( +

No Feedback Given

+ ) + } + + return ( + + + + + + + +
) } @@ -52,13 +72,8 @@ const App = () => {

Statistics

- - - - - - - + + ) } -- 2.51.2