diff options
Diffstat (limited to 'frontend/src/containers/lobby.js')
-rw-r--r-- | frontend/src/containers/lobby.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/frontend/src/containers/lobby.js b/frontend/src/containers/lobby.js index c36c3263..f0df0c44 100644 --- a/frontend/src/containers/lobby.js +++ b/frontend/src/containers/lobby.js @@ -1,15 +1,23 @@ import React, { Component } from 'react' import { connect } from 'react-redux' -import { List } from 'immutable' +import Immutable from 'seamless-immutable' import { Text } from 'rebass' import PlayerList from '../components/playerList' class Lobby extends Component { + getTitle() { + if (this.props.currentGame) { + return this.props.currentGame.name + } else { + return 'What are you doing here? You haven\'t joined a game yet!' + } + } + render() { return ( <div> - {this.props.currentGame && <Text>{this.props.currentGame.name}</Text>} + <Text>{this.getTitle()}</Text> <PlayerList players={this.props.players}/> </div> ) @@ -23,7 +31,7 @@ const mapStateToProps = (state) => { const game = getCurrentGame(state) return ({ currentGame: game, - players: game ? getPlayers(state, game.get('players')) : List() + players: game ? getPlayers(state, game.players) : Immutable([]) }) } |