implemented front end for displaying notifications

This commit is contained in:
Quentin Roussel
2024-04-18 11:41:05 +02:00
parent ae84c552f1
commit 884ca2ab9f
3 changed files with 53 additions and 1 deletions

View File

@@ -1,7 +1,9 @@
"use client";
import ActionDrawer from '@/components/team/actionDrawer';
import { Notification } from '@/components/team/notification';
import PlacementOverlay from '@/components/team/placementOverlay';
import { WaitingScreen } from '@/components/team/waitingScreen';
import { useSocket } from '@/context/socketContext';
import { useTeamConnexion } from '@/context/teamConnexionContext';
import useGame from '@/hook/useGame';
import { GameState } from '@/util/gameState';
@@ -19,8 +21,10 @@ const PlacementMap = dynamic(() => import('@/components/team/map').then((mod) =>
export default function Track() {
const { gameState, captured} = useGame();
const { useProtect } = useTeamConnexion();
const { teamSocket: socket} = useSocket();
useProtect();
return <>
<Notification socket={socket}/>
{gameState == GameState.SETUP && <WaitingScreen />}
{gameState == GameState.PLAYING && !captured && <div className='h-full'>
<LiveMap />