|
@@ -31,6 +31,7 @@ export default ({ afterCreate }) => {
|
|
|
const [loading, setLoading] = useState(false);
|
|
|
const [timer, setTimer] = useState(300);
|
|
|
const [rounds, setRounds] = useState(5);
|
|
|
+ const [onlyAmerica, setOnlyAmerica] = useState(false);
|
|
|
|
|
|
if (loading) {
|
|
|
return <Loading/>
|
|
@@ -38,7 +39,7 @@ export default ({ afterCreate }) => {
|
|
|
|
|
|
const onCreateGame = async () => {
|
|
|
setLoading(true);
|
|
|
- const gameId = await createGame(timer, rounds);
|
|
|
+ const gameId = await createGame(timer, rounds, onlyAmerica);
|
|
|
if (afterCreate) {
|
|
|
afterCreate(gameId);
|
|
|
}
|
|
@@ -68,6 +69,15 @@ export default ({ afterCreate }) => {
|
|
|
>
|
|
|
Rounds: {rounds}
|
|
|
</Dropdown>
|
|
|
+ <Dropdown
|
|
|
+ options={{
|
|
|
+ "All Countries": false,
|
|
|
+ "Just America": true,
|
|
|
+ }}
|
|
|
+ onChange={setOnlyAmerica}
|
|
|
+ >
|
|
|
+ {onlyAmerica ? "Just America" : "All Countries" }
|
|
|
+ </Dropdown>
|
|
|
</DropdownContainer>
|
|
|
<StartButton onClick={onCreateGame}>
|
|
|
Create New Game
|