+
-
+
)
diff --git a/traque-front/components/admin/teamList.jsx b/traque-front/components/admin/teamList.jsx
index 6cb878f..e83eeea 100644
--- a/traque-front/components/admin/teamList.jsx
+++ b/traque-front/components/admin/teamList.jsx
@@ -1,5 +1,6 @@
"use client";
import useAdmin from '@/hook/useAdmin';
+import { GameState } from '@/util/gameState';
import { DragDropContext, Draggable, Droppable } from '@hello-pangea/dnd';
import React from 'react'
import { useFormStatus } from 'react-dom';
@@ -20,8 +21,9 @@ const TEAM_STATUS = {
notready: { label: "En préparation", color: "text-custom-grey" },
};
-function TeamListItem({ team, index, onSelected, itemSelected }) {
- const status = TEAM_STATUS.captured; //Il faudrait ici implementer la logique, ce qui est normalement pas trop difficile
+function TeamListItem({ team, index, onSelected, itemSelected, gamestate }) {
+ console.log(gamestate === GameState.PLAYING ? "En jeu" : "En préparation");
+ const status = gamestate === GameState.PLAYING ? (team.captured ? TEAM_STATUS.captured : (team.outofzone ? TEAM_STATUS.outofzone : TEAM_STATUS.playing)) : (team.ready ? TEAM_STATUS.ready : TEAM_STATUS.notready);
return (
onSelected(team.id)}>
{provided => (
@@ -46,7 +48,7 @@ function TeamListItem({ team, index, onSelected, itemSelected }) {
}
export default function TeamList({selectedTeamId, onSelected}) {
- const {teams, reorderTeams} = useAdmin();
+ const {teams, reorderTeams, gameState} = useAdmin();
function onDragEnd(result) {
if (!result.destination) {
return;
@@ -71,7 +73,7 @@ export default function TeamList({selectedTeamId, onSelected}) {
{teams.map((team, i) => (
- onSelected(team.id)}>
-
+
))}
{provided.placeholder}
diff --git a/traque-front/hook/useAdmin.jsx b/traque-front/hook/useAdmin.jsx
index 8083b0e..2a692d9 100644
--- a/traque-front/hook/useAdmin.jsx
+++ b/traque-front/hook/useAdmin.jsx
@@ -11,7 +11,6 @@ export default function useAdmin() {
}
function getTeam(teamId) {
- console.log(teams[0]);
return teams.find(team => team.id === teamId);
}
diff --git a/traque-front/tailwind.config.js b/traque-front/tailwind.config.js
index ddc9e8a..584744e 100644
--- a/traque-front/tailwind.config.js
+++ b/traque-front/tailwind.config.js
@@ -8,6 +8,7 @@ module.exports = {
'custom-orange': '#fa6400',
'custom-blue': '#1e90ff',
'custom-grey': '#808080',
+ 'custom-light-blue': '#80b3ff'
}
}
},