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/lobby.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/lobby.js')
-rw-r--r-- | frontend/src/containers/lobby.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/frontend/src/containers/lobby.js b/frontend/src/containers/lobby.js new file mode 100644 index 00000000..c36c3263 --- /dev/null +++ b/frontend/src/containers/lobby.js @@ -0,0 +1,32 @@ +import React, { Component } from 'react' +import { connect } from 'react-redux' +import { List } from 'immutable' +import { Text } from 'rebass' +import PlayerList from '../components/playerList' + +class Lobby extends Component { + + render() { + return ( + <div> + {this.props.currentGame && <Text>{this.props.currentGame.name}</Text>} + <PlayerList players={this.props.players}/> + </div> + ) + } +} + +import { getPlayers } from '../redux/players' +import { getCurrentGame } from '../redux/games' + +const mapStateToProps = (state) => { + const game = getCurrentGame(state) + return ({ + currentGame: game, + players: game ? getPlayers(state, game.get('players')) : List() + }) +} + +const mapDispatchToProps = {} + +export default connect(mapStateToProps, mapDispatchToProps)(Lobby) |