From b58d937215ad96787bbd9e6981c79dd32e4b537c Mon Sep 17 00:00:00 2001 From: Thuan Bui Date: Thu, 26 Aug 2021 22:23:26 +0700 Subject: [PATCH] completed 1.14 (anecdotes step 3) --- part1/1.12-1.14-anecdotes/src/App.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/part1/1.12-1.14-anecdotes/src/App.js b/part1/1.12-1.14-anecdotes/src/App.js index db6b4ad..2e0a131 100644 --- a/part1/1.12-1.14-anecdotes/src/App.js +++ b/part1/1.12-1.14-anecdotes/src/App.js @@ -30,15 +30,16 @@ const App = () => { setPoints(newpoints) } - const Best = (props) => { + const BestNote = (props) => { const best = props.data const mostvote = Math.max(...best) const index = best.indexOf(mostvote); + return (

Anecdote with most votes

-

{props.notes[index]}

- has {mostvote} votes + {mostvote >0 &&

{props.notes[index]}

+ has {mostvote} votes
}
) } @@ -51,8 +52,7 @@ const App = () => { - - + )