|
@@ -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()
|