Functioning websocket connections
This commit is contained in:
parent
a227da52bc
commit
30db96a3f7
9 changed files with 104 additions and 182 deletions
|
@ -1,10 +1,12 @@
|
|||
import Icon from "./Icon"
|
||||
import Player from "./Player"
|
||||
import useGameState from "@lib/hooks/useGameState"
|
||||
import useSocket from "@lib/hooks/useSocket"
|
||||
import { Fragment, useEffect, useState } from "react"
|
||||
|
||||
function LobbyFrame({ openSettings }: { openSettings: () => void }) {
|
||||
const { payload } = useGameState().gameProps
|
||||
useSocket()
|
||||
const [dots, setDots] = useState(1)
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -18,7 +20,8 @@ function LobbyFrame({ openSettings }: { openSettings: () => void }) {
|
|||
<div className="flex items-center justify-between border-b-2 border-slate-900">
|
||||
<Icon src="speech_bubble.png">Chat</Icon>
|
||||
<h1 className="font-farro text-5xl font-medium">
|
||||
Game-PIN: <span className="underline">{payload?.gamePin?.pin}</span>
|
||||
Game-PIN:{" "}
|
||||
<span className="underline">{payload?.gamePin?.pin ?? "---"}</span>
|
||||
</h1>
|
||||
<Icon src="gear.png" onClick={openSettings}>
|
||||
Settings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue