summaryrefslogtreecommitdiff
path: root/frontend/src/containers/gameBrowser.js
diff options
context:
space:
mode:
authorVictor Chabbert <chabbertvi@eisti.eu>2017-07-31 18:48:19 +0200
committerVictor Chabbert <chabbertvi@eisti.eu>2017-08-07 22:41:20 +0200
commitd605156a5f61a1fe9d18bac8407cdec4ec0aa9a3 (patch)
tree35f7f80c75a91d30e1ba5c72e8bb487a1ccdbb52 /frontend/src/containers/gameBrowser.js
parentRefactor routes to new structure (diff)
downloadseven-wonders-d605156a5f61a1fe9d18bac8407cdec4ec0aa9a3.tar.gz
seven-wonders-d605156a5f61a1fe9d18bac8407cdec4ec0aa9a3.tar.bz2
seven-wonders-d605156a5f61a1fe9d18bac8407cdec4ec0aa9a3.zip
Remove containers folder
Diffstat (limited to 'frontend/src/containers/gameBrowser.js')
-rw-r--r--frontend/src/containers/gameBrowser.js65
1 files changed, 0 insertions, 65 deletions
diff --git a/frontend/src/containers/gameBrowser.js b/frontend/src/containers/gameBrowser.js
deleted file mode 100644
index a21d2e29..00000000
--- a/frontend/src/containers/gameBrowser.js
+++ /dev/null
@@ -1,65 +0,0 @@
-// @flow
-import type { List } from 'immutable';
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import { InlineForm, Space, Text } from 'rebass';
-import { Flex } from 'reflexbox';
-import GameList from '../components/gameList';
-import type { Games } from '../models/games';
-import type { Player } from '../models/players';
-import { actions, getAllGames } from '../redux/games';
-import { getCurrentPlayer } from '../redux/players';
-
-class GameBrowser extends Component {
- props: {
- currentPlayer: Player,
- games: List<Games>,
- createGame: (gameName: string) => void,
- joinGame: (gameId: string) => void
- };
-
- _gameName: string | void = undefined;
-
- createGame = (e: SyntheticEvent): void => {
- e.preventDefault();
- if (this._gameName !== undefined) {
- this.props.createGame(this._gameName);
- }
- };
-
- render() {
- return (
- <div>
- <Flex align="center" p={1}>
- <InlineForm
- buttonLabel="Create Game"
- label="Game name"
- name="game_name"
- onChange={(e: SyntheticInputEvent) => (this._gameName = e.target.value)}
- onClick={this.createGame}
- />
- <Space auto />
- <Text>
- <b>Username:</b>
- {' '}
- {this.props.currentPlayer && this.props.currentPlayer.displayName}
- </Text>
- <Space x={1} />
- </Flex>
- <GameList games={this.props.games} joinGame={this.props.joinGame} />
- </div>
- );
- }
-}
-
-const mapStateToProps = state => ({
- currentPlayer: getCurrentPlayer(state.get('players')),
- games: getAllGames(state.get('games')),
-});
-
-const mapDispatchToProps = {
- createGame: actions.requestCreateGame,
- joinGame: actions.requestJoinGame,
-};
-
-export default connect(mapStateToProps, mapDispatchToProps)(GameBrowser);
bgstack15