From b510a037b2521469a8b552f22b1d747509b74f07 Mon Sep 17 00:00:00 2001 From: Thuan Bui Date: Thu, 26 Aug 2021 20:26:57 +0700 Subject: [PATCH] Completed 1.9 (unicafe step 4) --- part1/1.6-1.11-unicafe/src/App.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/part1/1.6-1.11-unicafe/src/App.js b/part1/1.6-1.11-unicafe/src/App.js index 0a1dc1c..4157bcb 100644 --- a/part1/1.6-1.11-unicafe/src/App.js +++ b/part1/1.6-1.11-unicafe/src/App.js @@ -12,16 +12,22 @@ const App = () => { const all = good + bad + neutral const avg = (all !== 0) ? (good - bad) / all : 0 const positive = (all !== 0) ? good/all*100 : "NA" + return (

Statistic

-

Good: {good}

-

Neutral: {neutral}

-

Bad: {bad}

-

All: {all}

-

Average: {avg}

-

Positive: {positive} %

+ {all > 0 && +
+

Good: {good}

+

Neutral: {neutral}

+

Bad: {bad}

+

All: {all}

+

Average: {avg}

+

Positive: {positive} %

+
+ } + {all === 0 && "No feedback given"}
) } @@ -29,7 +35,7 @@ const App = () => { return (

Give feedback

- +