From b494d2d141a942b0905ac46a551ff42878f0f081 Mon Sep 17 00:00:00 2001 From: Joffrey BION Date: Thu, 11 May 2017 19:47:49 +0200 Subject: First attempt at lobby joining --- frontend/src/containers/lobby.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 frontend/src/containers/lobby.js (limited to 'frontend/src/containers/lobby.js') 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 ( +
+ {this.props.currentGame && {this.props.currentGame.name}} + +
+ ) + } +} + +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) -- cgit