Display kudos (as stars) in the per-round scores
authorCarl Worth <cworth@cworth.org>
Mon, 29 Jun 2020 21:28:35 +0000 (14:28 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 29 Jun 2020 21:28:35 +0000 (14:28 -0700)
Now that the server gives us this information, let's display it,
(otherwise, the players could be very confused about why some ties
were apparently broken in the sorting).

empathy/empathy.jsx

index 570e585b3076bda4117842acc009a209a357215b..6e98b327be7ceea20096c3a4e5eb56f3d95c3f0d 100644 (file)
@@ -1227,7 +1227,9 @@ class Game extends React.PureComponent {
               }
               return (
                 <li key={score.players[0]}>
-                {score.players.join("/")}: {score.score} {perfect} {quirkster}
+                  {score.players.join("/")}: {score.score}
+                  {score.kudos ? `, ${'★'.repeat(score.kudos)}` : ""}
+                  {perfect} {quirkster}
                 </li>
               );
             })}
@@ -1237,7 +1239,9 @@ class Game extends React.PureComponent {
             {state.scores.words.map(word => {
               return (
                 <li key={word.word}>
-                  {word.word} ({word.players.length}): {word.players.join(', ')}
+                  {word.word} ({word.players.length}
+                  {word.kudos.length ? `, ${'★'.repeat(word.kudos.length)}` : ""}
+                  ): {word.players.join(', ')}
                 </li>
               );
             })}