Updated the Create.jsx page
This commit is contained in:
parent
7f05195df7
commit
8a59ea02cc
@ -5,6 +5,7 @@ import {QRCodeSVG} from "qrcode.react";
|
||||
import Button from "@/common/components/Button";
|
||||
import {faPlay} from "@fortawesome/free-solid-svg-icons";
|
||||
import {GroupContext} from "@/common/contexts/GroupContext.jsx";
|
||||
import {useNavigate} from "react-router";
|
||||
|
||||
export const DOMAIN = "pmg.gnmyt.dev";
|
||||
export const BASE_URL = `https://${DOMAIN}/join?code=`;
|
||||
@ -12,6 +13,8 @@ export const BASE_URL = `https://${DOMAIN}/join?code=`;
|
||||
export const Create = () => {
|
||||
const [code, setCode] = useState("LOADING");
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
const {groups} = useContext(GroupContext);
|
||||
|
||||
const getRoomCode = () => {
|
||||
@ -30,7 +33,8 @@ export const Create = () => {
|
||||
<div className="create-page">
|
||||
<div className="info-area">
|
||||
<h2>Geht auf <span>{DOMAIN}</span> und gibt den Code <span>{code}</span> ein.</h2>
|
||||
{groups.length > 1 && <Button text={`Mit ${groups.length} Gruppen starten`} icon={faPlay} />}
|
||||
{groups.length > 1 && <Button text={`Mit ${groups.length} Gruppen starten`} icon={faPlay}
|
||||
onClick={() => navigate("/game")}/>}
|
||||
</div>
|
||||
<div className="qr-area">
|
||||
<QRCodeSVG value={BASE_URL + code} />
|
||||
|
Loading…
x
Reference in New Issue
Block a user