|
@@ -5,7 +5,7 @@ import Loading from "./Loading";
|
|
|
import Button from "./Button";
|
|
|
import { createGame } from "../../domain/apiMethods";
|
|
|
import Dropdown from "./Dropdown";
|
|
|
-import { MAP_CRUNCH, RANDOM_STREET_VIEW } from "../../domain/genMethods";
|
|
|
+import { MAP_CRUNCH, RANDOM_STREET_VIEW, URBAN } from "../../domain/genMethods";
|
|
|
|
|
|
const Container = styled.div`
|
|
|
display: flex;
|
|
@@ -39,6 +39,8 @@ export default ({ afterCreate }) => {
|
|
|
return <Loading/>
|
|
|
}
|
|
|
|
|
|
+ const invalidCombo = genMethod === URBAN && onlyAmerica;
|
|
|
+
|
|
|
const onCreateGame = async () => {
|
|
|
setLoading(true);
|
|
|
const gameId = await createGame(timer, rounds, onlyAmerica, genMethod);
|
|
@@ -85,14 +87,19 @@ export default ({ afterCreate }) => {
|
|
|
options={{
|
|
|
"Map Crunch": MAP_CRUNCH,
|
|
|
"Random Street View": RANDOM_STREET_VIEW,
|
|
|
+ "Urban Centers": URBAN,
|
|
|
}}
|
|
|
onChange={setGenMethod}
|
|
|
>
|
|
|
- Generator: {genMethod === MAP_CRUNCH ? "Map Crunch" : "RSV" }
|
|
|
+ Generator: {
|
|
|
+ genMethod === MAP_CRUNCH ? "Map Crunch" :
|
|
|
+ genMethod === RANDOM_STREET_VIEW ? "RSV" :
|
|
|
+ "Urban Centers"
|
|
|
+ }
|
|
|
</Dropdown>
|
|
|
</DropdownContainer>
|
|
|
- <StartButton onClick={onCreateGame}>
|
|
|
- New Game
|
|
|
+ <StartButton onClick={onCreateGame} disabled={invalidCombo}>
|
|
|
+ { invalidCombo ? "Incompatible Options" : "New Game" }
|
|
|
</StartButton>
|
|
|
</Container>
|
|
|
);
|