diff options
author | Joffrey BION <joffrey.bion@gmail.com> | 2017-05-11 19:47:49 +0200 |
---|---|---|
committer | Joffrey BION <joffrey.bion@gmail.com> | 2017-05-12 00:13:57 +0200 |
commit | b494d2d141a942b0905ac46a551ff42878f0f081 (patch) | |
tree | 18d94a3e86d0749f013075a110d6c43efaa782de /frontend/src/containers/gameBrowser.js | |
parent | Add time limit setting (diff) | |
download | seven-wonders-b494d2d141a942b0905ac46a551ff42878f0f081.tar.gz seven-wonders-b494d2d141a942b0905ac46a551ff42878f0f081.tar.bz2 seven-wonders-b494d2d141a942b0905ac46a551ff42878f0f081.zip |
First attempt at lobby joining
Diffstat (limited to 'frontend/src/containers/gameBrowser.js')
-rw-r--r-- | frontend/src/containers/gameBrowser.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/frontend/src/containers/gameBrowser.js b/frontend/src/containers/gameBrowser.js index 8c48f071..6a6b3ce2 100644 --- a/frontend/src/containers/gameBrowser.js +++ b/frontend/src/containers/gameBrowser.js @@ -6,9 +6,9 @@ import { Text } from 'rebass' import { Flex } from 'reflexbox' -import GamesList from '../components/gamesList' +import GameList from '../components/gameList' -class App extends Component { +class GameBrowser extends Component { createGame = (e) => { e.preventDefault() @@ -33,7 +33,7 @@ class App extends Component { <Text><b>Username:</b> {this.props.currentPlayer.get('displayName')}</Text> <Space x={1} /> </Flex> - <GamesList games={this.props.games} /> + <GameList games={this.props.games} joinGame={this.props.joinGame}/> </div> ) } @@ -41,14 +41,15 @@ class App extends Component { import { getCurrentPlayer } from '../redux/players' import { getAllGames, actions } from '../redux/games' + const mapStateToProps = (state) => ({ currentPlayer: getCurrentPlayer(state), games: getAllGames(state) }) - const mapDispatchToProps = { - createGame: actions.createGame + createGame: actions.requestCreateGame, + joinGame: actions.requestJoinGame } -export default connect(mapStateToProps, mapDispatchToProps)(App) +export default connect(mapStateToProps, mapDispatchToProps)(GameBrowser) |