import useGame from "@/hook/useGame" import { GreenButton, LogoutButton } from "../util/button"; import { useRef } from "react"; import Image from "next/image"; import { useTeamContext } from "@/context/teamContext"; export function WaitingScreen() { const { name, teamId } = useGame(); const { gameSettings } = useTeamContext(); const imageRef = useRef(null); var protocol = "https://"; if (process.env.NEXT_PUBLIC_SOCKET_HOST == "localhost") { protocol = "http://"; } const SERVER_URL = protocol + process.env.NEXT_PUBLIC_SOCKET_HOST + "/back"; console.log(SERVER_URL); function sendImage() { let data = new FormData(); data.append('file', document.querySelector('input[type="file"]').files[0]); fetch(SERVER_URL + "/upload?team=" + teamId.toString() , { method: 'POST', body: data }).then((response) => { console.log(response); refreshImage(); }); } function refreshImage() { imageRef.current.src = SERVER_URL + "/photo/my?team=" + teamId.toString() + "&t=" + new Date().getTime(); } return (
Uploadez une photo où tous les membres de l'équipe sont visibles