added zone settings in admin ui

This commit is contained in:
Quentin Roussel
2024-04-17 20:55:36 +02:00
parent 738b453e9c
commit 704a73ab73
6 changed files with 58 additions and 24 deletions

View File

@@ -1,5 +1,4 @@
import { useEffect, useState } from "react";
import { useLocation } from "./useLocation";
export function useMapCircleDraw(area, setArea) {
const [drawing, setDrawing] = useState(false);

View File

@@ -2,7 +2,7 @@ import { useAdminContext } from "@/context/adminContext";
import { useSocket } from "@/context/socketContext";
export default function useAdmin(){
const {teams, gameState, zone } = useAdminContext();
const {teams, gameState, zoneSettings } = useAdminContext();
const {adminSocket} = useSocket();
function pollTeams() {
@@ -38,10 +38,10 @@ export default function useAdmin(){
adminSocket.emit("change_state", state);
}
function setZone(zone) {
adminSocket.emit("set_zone", zone);
function changeZoneSettings(zone) {
adminSocket.emit("set_zone_settings", zone);
}
return {teams, zone, gameState,setZone, pollTeams, getTeam, getTeamName, reorderTeams, addTeam, removeTeam, changeState, updateTeam };
return {teams, zoneSettings, gameState,changeZoneSettings, pollTeams, getTeam, getTeamName, reorderTeams, addTeam, removeTeam, changeState, updateTeam };
}