diff options
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/src/components/lobby/Lobby.jsx | 5 | ||||
-rw-r--r-- | frontend/src/models/players.js | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/frontend/src/components/lobby/Lobby.jsx b/frontend/src/components/lobby/Lobby.jsx index df6557af..f352ab83 100644 --- a/frontend/src/components/lobby/Lobby.jsx +++ b/frontend/src/components/lobby/Lobby.jsx @@ -1,5 +1,5 @@ //@flow -import { Button } from '@blueprintjs/core'; +import { Button, Classes, Intent } from '@blueprintjs/core'; import { List } from 'immutable'; import React, { Component } from 'react'; import { connect } from 'react-redux'; @@ -25,7 +25,8 @@ class LobbyPresenter extends Component<LobbyProps> { <div> <h2>{currentGame.name + ' — Lobby'}</h2> <RadialPlayerList players={players} owner={currentGame.owner} currentPlayer={currentPlayer}/> - <Button onClick={startGame}>Start Game</Button> + {currentPlayer.gameOwner && <Button text="START" className={Classes.LARGE} intent={Intent.PRIMARY} icon='play' + onClick={startGame} disabled={players.size < 3}/>} </div> ); } diff --git a/frontend/src/models/players.js b/frontend/src/models/players.js index 2af6b0f7..587300f5 100644 --- a/frontend/src/models/players.js +++ b/frontend/src/models/players.js @@ -5,7 +5,9 @@ export type PlayerShape = { username: string, displayName: string, index: number, - ready: boolean + ready: boolean, + gameOwner: boolean, + user: boolean, }; export type PlayerType = Record<PlayerShape>; @@ -14,6 +16,8 @@ const PlayerRecord: PlayerType = Record({ displayName: null, index: 0, ready: false, + gameOwner: false, + user: false, }); // $FlowFixMe export class Player extends PlayerRecord {} |