aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--part1/unicafe/src/App.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/part1/unicafe/src/App.js b/part1/unicafe/src/App.js
index b583060..d2ef92b 100644
--- a/part1/unicafe/src/App.js
+++ b/part1/unicafe/src/App.js
@@ -8,12 +8,14 @@ const Button = (props) => {
)
}
-const Display = (props) => {
+const StatisticLine = (props) => {
return (
<p>{props.text} {props.count}</p>
)
}
+
+
const Statistics = (props) => {
const good = props.good
const bad = props.bad
@@ -26,12 +28,12 @@ const Statistics = (props) => {
const positive_percent = (good/total) * 100
return (
<>
- <Display text="good" count={good} />
- <Display text="neutral" count={bad} />
- <Display text="bad" count={bad} />
- <Display text="all" count={total} />
- <Display text="average" count={average} />
- <Display text="positive(%)" count={positive_percent} />
+ <StatisticLine text="good" count={good} />
+ <StatisticLine text="neutral" count={bad} />
+ <StatisticLine text="bad" count={bad} />
+ <StatisticLine text="all" count={total} />
+ <StatisticLine text="average" count={average} />
+ <StatisticLine text="positive(%)" count={positive_percent} />
</>
)
}