summaryrefslogtreecommitdiff
path: root/frontend/src/scenes/GameBrowser/index.js
diff options
context:
space:
mode:
authorJoffrey BION <joffrey.bion@gmail.com>2018-04-30 01:33:32 +0200
committerJoffrey BION <joffrey.bion@gmail.com>2018-04-30 01:33:32 +0200
commitd81f17d9487ad67353b7fa30b3ef5b7d81f404d6 (patch)
tree5060f40004d5b1c5387b233827292d14a154acba /frontend/src/scenes/GameBrowser/index.js
parentRemove unused former LobbyLayout... RIP (diff)
downloadseven-wonders-d81f17d9487ad67353b7fa30b3ef5b7d81f404d6.tar.gz
seven-wonders-d81f17d9487ad67353b7fa30b3ef5b7d81f404d6.tar.bz2
seven-wonders-d81f17d9487ad67353b7fa30b3ef5b7d81f404d6.zip
Add flow prop types in scene components
Diffstat (limited to 'frontend/src/scenes/GameBrowser/index.js')
-rw-r--r--frontend/src/scenes/GameBrowser/index.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/frontend/src/scenes/GameBrowser/index.js b/frontend/src/scenes/GameBrowser/index.js
index 20a835d1..7bb8b59d 100644
--- a/frontend/src/scenes/GameBrowser/index.js
+++ b/frontend/src/scenes/GameBrowser/index.js
@@ -10,7 +10,14 @@ import type { Player } from '../../models/players';
import { actions, getAllGames } from '../../redux/games';
import { getCurrentPlayer } from '../../redux/players';
-class GameBrowserPresenter extends Component {
+export type GameBrowserProps = {
+ currentPlayer: Player,
+ games: List<Game>,
+ createGame: (gameName: string) => void,
+ joinGame: (gameId: string) => void
+}
+
+class GameBrowserPresenter extends Component<GameBrowserProps> {
props: {
currentPlayer: Player,
games: List<Game>,
@@ -20,7 +27,7 @@ class GameBrowserPresenter extends Component {
_gameName: string | void = undefined;
- createGame = (e: SyntheticEvent): void => {
+ createGame = (e: SyntheticEvent<*>): void => {
e.preventDefault();
if (this._gameName !== undefined) {
this.props.createGame(this._gameName);
@@ -35,7 +42,7 @@ class GameBrowserPresenter extends Component {
buttonLabel="Create Game"
label="Game name"
name="game_name"
- onChange={(e: SyntheticInputEvent) => (this._gameName = e.target.value)}
+ onChange={(e: SyntheticInputEvent<*>) => (this._gameName = e.target.value)}
onClick={this.createGame}
/>
<Space auto />
bgstack15