|
@@ -1,7 +1,7 @@
|
|
|
import React, { useState } from "react";
|
|
|
import styled from "styled-components";
|
|
|
import Loading from "../../util/Loading";
|
|
|
-import PlayerNameInput from "./PlayerNameInput";
|
|
|
+import PlayerNameInput from "./../../util/PlayerNameInput";
|
|
|
import NewGameInput from "./NewGameInput"
|
|
|
import { createGame } from "../../../domain/GGSHService";
|
|
|
|
|
@@ -38,7 +38,6 @@ export default ({ initPlayerName, onGameJoined }) => {
|
|
|
return <Loading/>
|
|
|
}
|
|
|
|
|
|
- const onChangePlayerName = ({ target }) => setPlayerName(target.value);
|
|
|
const onCreateGame = async () => {
|
|
|
setLoading(true);
|
|
|
const gameId = await createGame(playerName, timer);
|
|
@@ -48,7 +47,7 @@ export default ({ initPlayerName, onGameJoined }) => {
|
|
|
|
|
|
return (
|
|
|
<Container>
|
|
|
- <PlayerNameInput {...{ playerName, onChangePlayerName }} />
|
|
|
+ <PlayerNameInput playerName={playerName} onChangePlayerName={setPlayerName} />
|
|
|
<Divider/>
|
|
|
<NewGameInput {...{ onCreateGame, cannotCreateGame, timer, setTimer }} />
|
|
|
</Container>
|