mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 10:20:16 +01:00
placement phase front end
This commit is contained in:
@@ -7,18 +7,34 @@ import dynamic from 'next/dynamic';
|
||||
import React from 'react'
|
||||
|
||||
//Load the map without SSR
|
||||
const LiveMap = dynamic(() => import('@/components/team/map'), {
|
||||
const LiveMap = dynamic(() => import('@/components/team/map').then((mod) => mod.LiveMap), {
|
||||
ssr: false
|
||||
});
|
||||
const PlacementMap = dynamic(() => import('@/components/team/map').then((mod) => mod.PlacementMap), {
|
||||
ssr: false
|
||||
});
|
||||
|
||||
export default function Track() {
|
||||
const { gameState } = useGame();
|
||||
const {useProtect} = useTeamConnexion();
|
||||
const { gameState, name, ready } = useGame();
|
||||
const { useProtect } = useTeamConnexion();
|
||||
useProtect();
|
||||
return (
|
||||
gameState == GameState.PLAYING && <div className='h-full'>
|
||||
return <>
|
||||
{gameState == GameState.PLAYING && <div className='h-full'>
|
||||
<LiveMap />
|
||||
<ActionDrawer />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
{gameState == GameState.PLACEMENT &&
|
||||
<div className='h-full'>
|
||||
<div className='fixed t-0 p-3 w-full bg-gray-300 shadow-xl rounded-b-xl flex flex-col z-10 justify-center items-center'>
|
||||
<div className='text-2xl my-3'>Placement</div>
|
||||
<div className='text-m'>{name}</div>
|
||||
{!ready && <div className='text-lg font-semibold text-red-700'>Positionez vous dans le cercle</div>}
|
||||
{ready && <div className='text-lg font-semibold text-green-700 text-center'>Restez dans le cercle en attendant que la partie commence</div>}
|
||||
|
||||
</div>
|
||||
<PlacementMap />
|
||||
</div>
|
||||
}
|
||||
</>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user