1
1
import { useContext } from "react" ;
2
2
import { GameContext } from "../GameContext" ;
3
- import {
4
- Button ,
5
- Spinner ,
6
- Table ,
7
- TableBody ,
8
- TableCell ,
9
- TableHead ,
10
- TableHeadCell ,
11
- TableRow ,
12
- } from "flowbite-react" ;
3
+ import { Button , Spinner , Table , TableBody , TableCell , TableHead , TableHeadCell , TableRow } from "flowbite-react" ;
13
4
import useApiClient from "../useApiClient" ;
14
5
import GameIdCopyButton from "./common/GameIdCopyButton" ;
15
6
import QRCode from "react-qr-code" ;
@@ -22,17 +13,14 @@ export default function WaitingToStartScreen() {
22
13
return < > </ > ;
23
14
}
24
15
25
- const isHost =
26
- game . players . find ( ( x ) => x . username === username ) ?. role === "Host" ;
16
+ const isHost = game . players . find ( ( x ) => x . username === username ) ?. role === "Host" ;
27
17
28
18
return (
29
- < div className = "flex flex-col max-w-(--breakpoint-md) mx-auto mb-8 items-stretch" >
19
+ < div className = "flex flex-col max-w-(--breakpoint-md) mx-auto mb-8 items-stretch px-1 " >
30
20
< div className = "text-center my-4" >
31
21
< Spinner />
32
22
</ div >
33
- < h1 className = "text-lg font-semibold self-center mb-5" >
34
- Waiting for Host to Start Game
35
- </ h1 >
23
+ < h1 className = "text-lg font-semibold self-center mb-5" > Waiting for Host to Start Game</ h1 >
36
24
< div className = "flex flex-wrap gap-4 justify-center" >
37
25
{ /* Players table */ }
38
26
< div className = "flex-1 min-w-[300px]" >
@@ -71,38 +59,29 @@ export default function WaitingToStartScreen() {
71
59
</ TableHead >
72
60
< TableBody >
73
61
< TableRow >
74
- < TableCell className = "items-middle text -center" >
75
- < div className = "inline-flex items-middle" >
62
+ < TableCell className = "flex flex-col items -center gap-4 " >
63
+ < div className = "inline-flex items-middle text-center " >
76
64
{ ! prefs . hideGameId ? (
77
65
< div >
78
- < span className = "py-2 pr-1" > Use Game ID </ span >
66
+ < span className = "py-2 pr-1" > Use Game ID</ span >
79
67
< GameIdCopyButton className = "text-gray-500 hover:bg-gray-100 active:bg-gray-200" />
80
- < span className = "py-2 pl-1" >
81
- to join or scan QR code
82
- </ span >
68
+ < span className = "py-2 pl-1" > to join, or scan the QR code:</ span >
83
69
</ div >
84
70
) : (
85
71
< div >
86
- < span className = "py-2 pr-1" >
87
- Click to copy Game URL{ " " }
88
- </ span >
72
+ < span className = "py-2 pr-1" > Click to copy Game URL</ span >
89
73
< GameIdCopyButton className = "text-gray-500 hover:bg-gray-100 active:bg-gray-200" />
90
74
< span className = "py-2 pl-1" > </ span >
91
75
</ div >
92
76
) }
93
77
</ div >
94
- < div >
95
- { ! prefs . hideGameId ? (
96
- < TableCell >
97
- < QRCode
98
- style = { { height : "auto" , maxWidth : "100%" } }
99
- value = { window . location . href + "?gameId=" + game . id }
100
- />
101
- </ TableCell >
102
- ) : (
103
- < > </ >
104
- ) }
105
- </ div >
78
+ { ! prefs . hideGameId ? (
79
+ < div >
80
+ < QRCode style = { { height : "auto" , width : "auto" } } value = { window . location . href + "?gameId=" + game . id } />
81
+ </ div >
82
+ ) : (
83
+ < > </ >
84
+ ) }
106
85
</ TableCell >
107
86
</ TableRow >
108
87
</ TableBody >
@@ -111,12 +90,7 @@ export default function WaitingToStartScreen() {
111
90
</ div >
112
91
113
92
{ isHost ? (
114
- < Button
115
- className = "mt-4"
116
- color = "success"
117
- size = "lg"
118
- onClick = { apiClient . startGame }
119
- >
93
+ < Button className = "mt-4" color = "green" size = "lg" onClick = { apiClient . startGame } >
120
94
Start Game
121
95
</ Button >
122
96
) : (
0 commit comments