|
@@ -5,9 +5,18 @@ import ClickToCopy from '../../util/ClickToCopy';
|
|
import Loading from '../../util/Loading';
|
|
import Loading from '../../util/Loading';
|
|
import LinkedGame from './LinkedGame';
|
|
import LinkedGame from './LinkedGame';
|
|
import styles from './PlayerScores.module.css';
|
|
import styles from './PlayerScores.module.css';
|
|
-import ScoreBoard from './ScoreBoard';
|
|
|
|
|
|
+import PlayerScoreTile from './PlayerScoreTile';
|
|
import SummaryMap from './SummaryMap';
|
|
import SummaryMap from './SummaryMap';
|
|
|
|
|
|
|
|
+const ScoreBoard = ({ players }) => (
|
|
|
|
+ <div className={styles.scoreboard}>
|
|
|
|
+ {players
|
|
|
|
+ .filter(({ currentRound }) => currentRound === null)
|
|
|
|
+ .sort((p1, p2) => (p1.totalScore > p2.totalScore ? -1 : p1.totalScore < p2.totalScore ? 1 : 0))
|
|
|
|
+ .map((data) => <PlayerScoreTile key={data.name} {...data} />)}
|
|
|
|
+ </div>
|
|
|
|
+);
|
|
|
|
+
|
|
export default () => {
|
|
export default () => {
|
|
// poll the game state
|
|
// poll the game state
|
|
const gameId = useGameId();
|
|
const gameId = useGameId();
|