fix endgame

pull/84/head
Thomas Chazot 1 year ago
parent f0339b2257
commit 157afc8a65

@ -494,7 +494,7 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
setActualPlayerIndexData(-1) setActualPlayerIndexData(-1)
setLastIndex(-1) setLastIndex(-1)
setPlayerTouched(-1) setPlayerTouched(-1)
setWinnerData(players[winnerIndex]) setWinnerData(winner)
setElapsedTime(0) setElapsedTime(0)
first = true first = true

@ -75,9 +75,11 @@ function EndGame() {
} }
const theme = useTheme(); const theme = useTheme();
console.log(winner)
return ( return (
<div> <div>
{!IsSolo && {!IsSolo ? (
<div> <div>
<div className="head"> <div className="head">
<header className='leaderboard-header' style={{ borderColor: theme.colors.primary }}> <header className='leaderboard-header' style={{ borderColor: theme.colors.primary }}>
@ -110,42 +112,45 @@ function EndGame() {
</div> </div>
</div> </div>
</div> </div>
} ): (
<div className="head"> <div>
<header className='leaderboard-header' style={{ borderColor: theme.colors.primary }}> <div className="head">
<h1>Vous avez gagné !</h1> <header className='leaderboard-header' style={{ borderColor: theme.colors.primary }}>
<h3>Le tueur était <u>{person?.getName()}</u></h3> <h1>Vous avez gagné !</h1>
</header> <h3>Le tueur était <u>{person?.getName()}</u></h3>
</div> </header>
<div className='winner'> </div>
<img src={Person} width='250' height='250'/> <div className='winner'>
<h1>{winner?.pseudo}</h1> <img src={Person} width='250' height='250'/>
</div> <h1>{winner?.pseudo}</h1>
<div className='bottom'>
<div className='centerDivH' onClick={resetAll}>
<BigButtonNav dest="/play" img={Leave}/>
</div> </div>
<div className="SoloContainer">
<div className='solostat'> <div className='bottom'>
{!IsDaily && <p>Nombre de coups : {nbCoup}</p> } <div className='centerDivH' onClick={resetAll}>
<p>Temps : {temps}s</p> <BigButtonNav dest="/play" img={Leave}/>
</div> </div>
<div className='indicesolo'> <div className="SoloContainer">
{indices.map((indice, index) => ( <div className='solostat'>
// <div className="playerContainer" key={index}> {!IsDaily && <p>Nombre de coups : {nbCoup}</p> }
<div> <p>Temps : {temps}s</p>
<h6 className='indiceDisplay'> <u>Indice {index+1}</u> : {indice.ToString("fr")}</h6> </div>
</div> <div className='indicesolo'>
//</div> {indices.map((indice, index) => (
)) // <div className="playerContainer" key={index}>
} <div>
<h6 className='indiceDisplay'> <u>Indice {index+1}</u> : {indice.ToString("fr")}</h6>
</div>
//</div>
))
}
</div>
</div>
<div className='centerDivH'>
<BigButtonNav dest="/lobby" img={Replay}/>
</div> </div>
</div>
<div className='centerDivH'>
<BigButtonNav dest="/lobby" img={Replay}/>
</div> </div>
</div> </div>
)}
</div> </div>
); );
} }

@ -122,7 +122,7 @@ function Lobby() {
gameStarted = true gameStarted = true
socket.off("player left") socket.off("player left")
socket.off("new player") socket.off("new player")
navigate('/game?solo=false'); navigate('/game?solo=false&daily=false');
}); });
socket.on("new player", (tab) =>{ socket.on("new player", (tab) =>{

Loading…
Cancel
Save