Browse Source

Tweak recent game display to show duel where relevant

Kirk Trombley 3 years ago
parent
commit
7fdef2d13a
1 changed files with 3 additions and 2 deletions
  1. 3 2
      client/src/components/screens/HomePage/RecentGames.jsx

+ 3 - 2
client/src/components/screens/HomePage/RecentGames.jsx

@@ -1,4 +1,5 @@
 import ms from "pretty-ms";
+import { RACE } from "../../../domain/constants";
 import { dispatch } from "../../../domain/gameStore";
 import { useRecentGameInfo } from "../../../hooks/useGameInfo";
 import styles from "./HomePage.module.css";
@@ -9,7 +10,7 @@ const RecentGames = () => {
     <div className={styles.recentSection}>
       <div className={styles.recentTitle}>Recently Created Games:</div>
       {recent?.map(
-        ({ gameId, gameMode, rounds, timer, player, numPlayers }) => (
+        ({ gameId, gameMode, clockMode, rounds, timer, player, numPlayers }) => (
           <button
             key={gameId}
             type="button"
@@ -17,7 +18,7 @@ const RecentGames = () => {
             onClick={() => dispatch.goToLobby(gameId)}
           >
             <div>
-              {gameMode
+              {clockMode === RACE ? "Duel" : gameMode
                 .split("_")
                 .map(
                   part => part[0].toUpperCase() + part.slice(1).toLowerCase()