Browse Source

Add in RaceMode component

Kirk Trombley 5 năm trước cách đây
mục cha
commit
8434fb4434

+ 3 - 1
client/src/components/screens/GamePanel/GamePanel.jsx

@@ -1,12 +1,13 @@
 import React, { useEffect } from 'react';
 import { dispatch, useCurrentRound } from '../../../domain/gameStore';
-import { FROZEN } from '../../../domain/ruleSets';
+import { FROZEN, RACE } from '../../../domain/ruleSets';
 import { useGameConfig } from '../../../hooks/useGameInfo';
 import usePreventNavigation from '../../../hooks/usePreventNavigation';
 import Loading from '../../util/Loading';
 import styles from './GamePanel.module.css';
 import GuessPane from './GuessPane';
 import PositionedStreetView from './PositionedStreetView';
+import RaceMode from './RaceMode';
 
 export default () => {
   // warn the user if they navigate away
@@ -26,6 +27,7 @@ export default () => {
     <Loading />
   ) : (
     <div className={styles.page}>
+      {ruleSet === RACE && <RaceMode rate={1000} cutoffTime={10}/>}
       <div className={styles.streetview}>
         <PositionedStreetView />
         {ruleSet === FROZEN && <div className={styles.freeze} />}

+ 2 - 1
client/src/domain/ruleSets.js

@@ -1,3 +1,4 @@
 export const NORMAL = "NORMAL";
 export const TIME_BANK = "TIMEBANK";
-export const FROZEN = "FROZEN";
+export const FROZEN = "FROZEN";
+export const RACE = "RACE";