Implemented isReady & isConnected
This commit is contained in:
parent
4fa3b9ae64
commit
df315df8f4
13 changed files with 347 additions and 80 deletions
|
@ -1,6 +1,10 @@
|
|||
import Button from "./Button"
|
||||
import Icon from "./Icon"
|
||||
import Player from "./Player"
|
||||
import { faSpinnerThird } from "@fortawesome/pro-solid-svg-icons"
|
||||
import {
|
||||
faRightFromBracket,
|
||||
faSpinnerThird,
|
||||
} from "@fortawesome/pro-solid-svg-icons"
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
||||
import { useGameProps } from "@hooks/useGameProps"
|
||||
import useSocket from "@hooks/useSocket"
|
||||
|
@ -16,6 +20,7 @@ function WithDots({ children }: { children: string }) {
|
|||
const interval = setInterval(() => setDots((e) => (e % 3) + 1), 1000)
|
||||
return () => clearInterval(interval)
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<>
|
||||
{children + " "}
|
||||
|
@ -75,9 +80,9 @@ function LobbyFrame({ openSettings }: { openSettings: () => void }) {
|
|||
</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex items-center justify-center border-t-2 border-slate-900">
|
||||
<button
|
||||
className="font-farro mx-32 my-4 rounded-xl border-b-4 border-red-400 bg-red-500 px-12 py-4 text-5xl font-medium duration-100 active:border-b-0 active:border-t-4"
|
||||
<div className="flex items-center justify-around border-t-2 border-slate-900 p-4">
|
||||
<Button
|
||||
type="red"
|
||||
onClick={() => {
|
||||
leave(async () => {
|
||||
await router.push("/")
|
||||
|
@ -85,11 +90,9 @@ function LobbyFrame({ openSettings }: { openSettings: () => void }) {
|
|||
})
|
||||
}}
|
||||
>
|
||||
LEAVE
|
||||
</button>
|
||||
<button className="font-farro mx-32 my-4 rounded-xl border-b-4 border-orange-400 bg-warn px-12 py-4 text-5xl font-medium duration-100 active:border-b-0 active:border-t-4">
|
||||
START
|
||||
</button>
|
||||
<span>LEAVE</span>
|
||||
<FontAwesomeIcon icon={faRightFromBracket} className="ml-4 w-12" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue