Functioning websocket connections

This commit is contained in:
aronmal 2023-04-27 17:41:16 +02:00
parent a227da52bc
commit 30db96a3f7
Signed by: aronmal
GPG key ID: 816B7707426FC612
9 changed files with 104 additions and 182 deletions

View file

@ -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