From b6f54ed56121aa5435dd813c952b292b25b56bfb Mon Sep 17 00:00:00 2001 From: Joffrey BION Date: Sun, 14 May 2017 18:43:58 +0200 Subject: Add lobby saga - Fix lobby's player list updates - Fix lobby's player list order - Add 'start game' button (not restricted to owner yet) Resolves: https://github.com/luxons/seven-wonders/issues/7 --- frontend/src/containers/lobby.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'frontend/src/containers/lobby.js') diff --git a/frontend/src/containers/lobby.js b/frontend/src/containers/lobby.js index f0df0c44..e326698f 100644 --- a/frontend/src/containers/lobby.js +++ b/frontend/src/containers/lobby.js @@ -1,14 +1,14 @@ import React, { Component } from 'react' import { connect } from 'react-redux' import Immutable from 'seamless-immutable' -import { Text } from 'rebass' +import { Button } from 'rebass' import PlayerList from '../components/playerList' class Lobby extends Component { getTitle() { if (this.props.currentGame) { - return this.props.currentGame.name + return this.props.currentGame.name + ' — Lobby' } else { return 'What are you doing here? You haven\'t joined a game yet!' } @@ -17,15 +17,16 @@ class Lobby extends Component { render() { return (
- {this.getTitle()} +

{this.getTitle()}

+
) } } import { getPlayers } from '../redux/players' -import { getCurrentGame } from '../redux/games' +import { getCurrentGame, actions } from '../redux/games' const mapStateToProps = (state) => { const game = getCurrentGame(state) @@ -35,6 +36,8 @@ const mapStateToProps = (state) => { }) } -const mapDispatchToProps = {} +const mapDispatchToProps = { + startGame: actions.requestStartGame +} export default connect(mapStateToProps, mapDispatchToProps)(Lobby) -- cgit