Skip to content

Commit

Permalink
hide buttons while playing dev cards
Browse files Browse the repository at this point in the history
  • Loading branch information
zarns committed Nov 5, 2024
1 parent cb4b99c commit 3b2f398
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ui/src/pages/ActionsToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function PlayButtons() {
[enqueueSnackbar, closeSnackbar]
);

const { gameState, isPlayingMonopoly, isPlayingYearOfPlenty } = state;
const { gameState, isPlayingMonopoly, isPlayingYearOfPlenty, isRoadBuilding } = state;
const key = playerKey(gameState, gameState.current_color);
const isRoll =
gameState.current_prompt === "PLAY_TURN" &&
Expand Down Expand Up @@ -198,31 +198,31 @@ function PlayButtons() {
return (
<>
<OptionsButton
disabled={playableDevCardTypes.size === 0 || isPlayingYearOfPlenty}
disabled={playableDevCardTypes.size === 0 || isPlayingMonopoly || isPlayingYearOfPlenty || isRoadBuilding}
menuListId="use-menu-list"
icon={<SimCardIcon />}
items={useItems}
>
Use
</OptionsButton>
<OptionsButton
disabled={buildActionTypes.size === 0 || isPlayingYearOfPlenty}
disabled={buildActionTypes.size === 0 || isPlayingMonopoly || isPlayingYearOfPlenty || isRoadBuilding}
menuListId="build-menu-list"
icon={<BuildIcon />}
items={buildItems}
>
Buy
</OptionsButton>
<OptionsButton
disabled={tradeItems.length === 0 || isPlayingYearOfPlenty}
disabled={tradeItems.length === 0 || isPlayingMonopoly || isPlayingYearOfPlenty || isRoadBuilding}
menuListId="trade-menu-list"
icon={<AccountBalanceIcon />}
items={tradeItems}
>
Trade
</OptionsButton>
<Button
disabled={gameState.is_initial_build_phase}
disabled={gameState.is_initial_build_phase || isRoadBuilding}
variant="contained"
color="primary"
startIcon={<NavigateNextIcon />}
Expand Down

0 comments on commit 3b2f398

Please sign in to comment.