1
0

Move QUIT to an action instead of in the active player list

Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
James Ketrenos 2022-02-03 12:00:51 -08:00
parent ebaa4529a4
commit 22156373e0

View File

@ -283,14 +283,19 @@ const Action = ({ table }) => {
const passClick = (event) => {
}
const quitClick = (event) => {
table.setSelected("");
}
if (!table.game) {
console.log("Why no game?");
return (<Paper className="Action"/>);
}
const inLobby = table.game.state === 'lobby';
return (
<Paper className="Action">
{ table.game.state === 'lobby' && <>
{ inLobby && <>
<StartButton table={table}/>
<Button disabled={!table.game.color} onClick={newTableClick}>New table</Button>
<Button disabled={table.game.color ? true : false} onClick={() => {table.setState({ pickName: true})}}>Change name</Button> </> }
@ -300,6 +305,9 @@ const Action = ({ table }) => {
<Button onClick={rollClick}>Roll Dice</Button>
<Button disabled onClick={passClick}>Pass Turn</Button>
</> }
{ !inLobby &&
<Button onClick={quitClick}>Quit</Button>
}
</Paper>
);
}
@ -384,9 +392,6 @@ const Players = ({ table }) => {
{ item.status + ' ' }
{ item.status !== 'Not active' && <Moment fromNow date={item.lastActive > Date.now() ? Date.now() : item.lastActive}/>}
</>)} />
{ !inLobby && table.game.color === color &&
<Button onClick={() => toggleSelected(color)}>Quit</Button>
}
</div>
));
}