import "./styles.sass"; import ActionCard from "@/pages/Home/components/ActionCard"; import JoinForm from "@/pages/Home/components/JoinForm"; import CreateForm from "@/pages/Home/components/CreateForm"; import {faArrowRightToBracket, faPlusSquare} from "@fortawesome/free-solid-svg-icons"; import {StateContext} from "@/common/contexts/StateContext"; import {SocketContext} from "@/common/contexts/SocketContext"; import {useContext, useState} from "react"; export const Home = () => { const {setCurrentState} = useContext(StateContext); const {connect, send} = useContext(SocketContext); const [homeState, setHomeState] = useState("initial"); // initial, joining, creating const handleJoinClick = () => { setHomeState("joining"); }; const handleCreateClick = () => { setHomeState("creating"); }; const handleBack = () => { setHomeState("initial"); }; const handleJoinSubmit = (name, roomCode) => { connect(); send("joinRoom", {name, roomCode}); setCurrentState("Game"); }; const handleCreateSubmit = (name) => { connect(); send("createRoom", {name}); setCurrentState("Game"); }; return (

ToneGuessr

Das Frequenzspiel für Marco :3

{homeState === 'joining' && ( )}
{homeState === 'creating' && ( )}
); }