79 | {!hideShare ? (
80 |
81 |
82 |
83 | ) : (
84 |
89 | {t("title", "Fishbowl")}
90 |
91 | )}
92 |
93 |
94 |
95 | {currentPlayer.role === PlayerRole.Host && (
96 | <>
97 |
98 | {
101 | setCardPlayStyle(value as GameCardPlayStyleEnum)
102 | updateGameSettings({
103 | variables: {
104 | id: currentGame.id,
105 | input: {
106 | card_play_style: value as GameCardPlayStyleEnum,
107 | },
108 | },
109 | })
110 | }}
111 | debouncedSetWordList={debouncedSetWordList}
112 | >
113 |
114 |
115 | >
116 | )}
117 |
118 |
119 |
120 |
121 |
122 |
123 | {t("lobby.heading", "Lobby")}
124 |
125 |
126 |
127 |
131 |
132 |
136 |
137 |
138 |
139 |
140 | {currentPlayer.role === PlayerRole.Participant && (
141 | <>
142 |
143 |
144 |
145 |
146 | >
147 | )}
148 |
149 | )
150 | }
151 |
152 | export default Lobby
153 |
--------------------------------------------------------------------------------
/app/src/pages/CardSubmission/WaitingForSubmissions.tsx:
--------------------------------------------------------------------------------
1 | import { Grid, Typography } from "@material-ui/core"
2 | import Fishbowl from "components/Fishbowl"
3 | import PlayerChip from "components/PlayerChip"
4 | import ScreenCard from "components/ScreenCard"
5 | import { CurrentGameContext } from "contexts/CurrentGame"
6 | import { CurrentPlayerContext, PlayerRole } from "contexts/CurrentPlayer"
7 | import { filter, reject } from "lodash"
8 | import { Title } from "pages/CardSubmission"
9 | import AssignTeamsButton from "pages/CardSubmission/AssignTeamsButton"
10 | import * as React from "react"
11 | import { useTranslation } from "react-i18next"
12 |
13 | enum WaitingForSubmissionsState {
14 | Waiting,
15 | SubmittedAssign,
16 | SubmittedWait,
17 | }
18 |
19 | function WaitingForSubmissions() {
20 | const { t } = useTranslation()
21 | const currentGame = React.useContext(CurrentGameContext)
22 | const currentPlayer = React.useContext(CurrentPlayerContext)
23 |
24 | const numEntriesPerPlayer = currentGame.num_entries_per_player
25 | const numPlayers = currentGame.players.length
26 |
27 | if (!numEntriesPerPlayer || !numPlayers) {
28 | return null
29 | }
30 |
31 | const total = numEntriesPerPlayer * numPlayers
32 | const submittedOrAcceptedSoFar = currentGame.cards.length
33 |
34 | const waitingForPlayers = reject(currentGame.players, (player) => {
35 | return (
36 | filter(currentGame.cards, (card) => card.player_id === player.id)
37 | .length === numEntriesPerPlayer
38 | )
39 | })
40 |
41 | if (!submittedOrAcceptedSoFar) {
42 | return null
43 | }
44 |
45 | let state: WaitingForSubmissionsState
46 |
47 | if (total === 0 || submittedOrAcceptedSoFar !== total) {
48 | state = WaitingForSubmissionsState.Waiting
49 | } else if (PlayerRole.Host === currentPlayer.role) {
50 | state = WaitingForSubmissionsState.SubmittedAssign
51 | } else {
52 | state = WaitingForSubmissionsState.SubmittedWait
53 | }
54 |
55 | const unscreenedCards =
56 | PlayerRole.Host === currentPlayer.role && currentGame.screen_cards
57 | ? currentGame.cards.filter(
58 | (card) =>
59 | card.is_allowed === null && card.player_id !== currentPlayer.id
60 | )
61 | : []
62 |
63 | return (
64 | <>
65 |