diff --git a/cryptide_project/src/Components/GraphContainer.tsx b/cryptide_project/src/Components/GraphContainer.tsx index 83697dd..634f495 100644 --- a/cryptide_project/src/Components/GraphContainer.tsx +++ b/cryptide_project/src/Components/GraphContainer.tsx @@ -811,7 +811,7 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS socket.off("put imossible grey") socket.off("who plays") - navigate(`${basePath}/endgame`) + navigate(`/${basePath}/endgame`) } } }) @@ -1020,7 +1020,7 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS catch(error){ console.log(error); } - navigate(`${basePath}/endgame?solo=true+${isDaily}`) + navigate(`/${basePath}/endgame?solo=true+${isDaily}`) } } diff --git a/cryptide_project/src/Components/LobbyContainer.tsx b/cryptide_project/src/Components/LobbyContainer.tsx index 797cef5..ac0037c 100644 --- a/cryptide_project/src/Components/LobbyContainer.tsx +++ b/cryptide_project/src/Components/LobbyContainer.tsx @@ -49,7 +49,7 @@ const LobbyContainer: React.FC = ({roomNum, HeadPlayer, nbP if (nbPlayer < 6 && !started) { socket.off("request lobbies") setFirst(true) - navigate(`${basePath}/${dest}`); + navigate(`/${basePath}/${dest}`); } else if(started){ handleShowStart() diff --git a/cryptide_project/src/Components/NavBar.tsx b/cryptide_project/src/Components/NavBar.tsx index 5921026..75b45c6 100644 --- a/cryptide_project/src/Components/NavBar.tsx +++ b/cryptide_project/src/Components/NavBar.tsx @@ -37,11 +37,11 @@ function AppNavbar({changeLocale}) { function navigateToProfile(){ - navigate(`${basePath}/profile`) + navigate(`/${basePath}/profile`) } function navigateToHome(){ - navigate(`${basePath}/`) + navigate(`/${basePath}/`) } return ( diff --git a/cryptide_project/src/Pages/InGame.tsx b/cryptide_project/src/Pages/InGame.tsx index 9b20931..099b6ea 100644 --- a/cryptide_project/src/Pages/InGame.tsx +++ b/cryptide_project/src/Pages/InGame.tsx @@ -68,7 +68,7 @@ const InGame = ({locale, changeLocale}) => { if (cptNavigation % 2 == 0){ if (navigationType.toString() == "POP"){ socket.emit("player quit") - navigate(`${basePath}/play`) + navigate(`/${basePath}/play`) } } diff --git a/cryptide_project/src/Pages/Lobby.tsx b/cryptide_project/src/Pages/Lobby.tsx index 572c36a..248c8cc 100644 --- a/cryptide_project/src/Pages/Lobby.tsx +++ b/cryptide_project/src/Pages/Lobby.tsx @@ -136,7 +136,7 @@ function Lobby() { gameStarted = true //socket.off("player left") //socket.off("new player") - navigate(`${basePath}/game?solo=false&daily=false`); + navigate(`/${basePath}/game?solo=false&daily=false`); }); @@ -172,7 +172,7 @@ function Lobby() { setIndicesData(choosenIndices) first = true gameStarted = true - navigate(`${basePath}/game?solo=false&daily=false`) + navigate(`/${basePath}/game?solo=false&daily=false`) }); socket.on("new player", (tab) =>{ @@ -187,17 +187,17 @@ function Lobby() { socket.on("room full", () => { //TODO POP UP pour quand la room est pleine - navigate(`${basePath}/play`) + navigate(`/${basePath}/play`) }) socket.on("game started", () => { //TODO POP UP pour quand la room est pleine - navigate(`${basePath}/play`) + navigate(`/${basePath}/play`) }) socket.on("game already started", () => { //TODO POP UP pour quand la room est pleine - navigate(`${basePath}/play`) + navigate(`/${basePath}/play`) }) socket.on("player left", (tab, i) => { diff --git a/cryptide_project/src/Pages/LoginForm.tsx b/cryptide_project/src/Pages/LoginForm.tsx index dde8427..764e0f5 100644 --- a/cryptide_project/src/Pages/LoginForm.tsx +++ b/cryptide_project/src/Pages/LoginForm.tsx @@ -37,7 +37,7 @@ const SignIn = () => { setShowConfirmation(true); setTimeout(async () => { await login(); - navigate(`${basePath}/`); + navigate(`/${basePath}/`); }, 1250); } } catch (error: any) { diff --git a/cryptide_project/src/Pages/NewPlay.tsx b/cryptide_project/src/Pages/NewPlay.tsx index 8c658f1..2cc7999 100644 --- a/cryptide_project/src/Pages/NewPlay.tsx +++ b/cryptide_project/src/Pages/NewPlay.tsx @@ -100,7 +100,7 @@ function NewPlay() { setPersonNetworkData(networkPerson) setIndicesData(choosenIndices) setIndicesData(choosenIndices) - navigate(`${basePath}/game?solo=true&daily=false`); + navigate(`/${basePath}/game?solo=true&daily=false`); } @@ -131,12 +131,12 @@ function NewPlay() { useEffect(() => { if (room !== null) { const nouvelleURL = `/lobby?room=${room}`; - navigate(`${basePath}${nouvelleURL}`) + navigate(`/${basePath}${nouvelleURL}`) } }, [room, navigate]); const goBack = () => { - navigate(`${basePath}/lobby?room=${goBackRoom}`) + navigate(`/${basePath}/lobby?room=${goBackRoom}`) } @@ -159,7 +159,7 @@ function NewPlay() { setIndicesData(choosenIndices) setIndicesData(choosenIndices) - navigate(`${basePath}/game?solo=true&daily=true&easy=true`); + navigate(`/${basePath}/game?solo=true&daily=true&easy=true`); setShowOverlay(false); }; @@ -177,7 +177,7 @@ function NewPlay() { const map = EnigmeDuJourCreator.createEnigme(networkPerson, choosenIndices, choosenPerson, Stub.GenerateIndice()) setDailyEnigmeData(map) } - navigate(`${basePath}/game?solo=true&daily=true&easy=false`); + navigate(`/${basePath}/game?solo=true&daily=true&easy=false`); setShowOverlay(false); }; diff --git a/cryptide_project/src/Pages/Play.tsx b/cryptide_project/src/Pages/Play.tsx index e783f53..097d73d 100644 --- a/cryptide_project/src/Pages/Play.tsx +++ b/cryptide_project/src/Pages/Play.tsx @@ -100,7 +100,7 @@ function Play() { setPersonNetworkData(networkPerson) setIndicesData(choosenIndices) setIndicesData(choosenIndices) - navigate(`${basePath}/game?solo=true&daily=false`); + navigate(`/${basePath}/game?solo=true&daily=false`); } @@ -131,12 +131,12 @@ function Play() { useEffect(() => { if (room !== null) { const nouvelleURL = `/lobby?room=${room}`; - navigate(`${basePath}${nouvelleURL}`); + navigate(`/${basePath}${nouvelleURL}`); } }, [room, navigate]); const goBack = () => { - navigate(`${basePath}/lobby?room=${goBackRoom}`) + navigate(`/${basePath}/lobby?room=${goBackRoom}`) } @@ -159,7 +159,7 @@ function Play() { setIndicesData(choosenIndices) setIndicesData(choosenIndices) - navigate(`${basePath}/game?solo=true&daily=true&easy=true`); + navigate(`/${basePath}/game?solo=true&daily=true&easy=true`); setShowOverlay(false); }; @@ -177,7 +177,7 @@ function Play() { const map = EnigmeDuJourCreator.createEnigme(networkPerson, choosenIndices, choosenPerson, Stub.GenerateIndice()) setDailyEnigmeData(map) } - navigate(`${basePath}/game?solo=true&daily=true&easy=false`); + navigate(`/${basePath}/game?solo=true&daily=true&easy=false`); setShowOverlay(false); }; @@ -240,7 +240,7 @@ function Play() { - +
diff --git a/cryptide_project/src/Pages/Profile.tsx b/cryptide_project/src/Pages/Profile.tsx index a59ad2e..91e1bf9 100644 --- a/cryptide_project/src/Pages/Profile.tsx +++ b/cryptide_project/src/Pages/Profile.tsx @@ -186,7 +186,7 @@ const Profile = () => { } handleCloseDeleteModal(); - navigate(`${basePath}/`) + navigate(`/${basePath}/`) } else { console.error('Phrase de confirmation incorrecte.'); diff --git a/cryptide_project/src/Pages/SignUpForm.tsx b/cryptide_project/src/Pages/SignUpForm.tsx index 9e29449..f7f2a1a 100644 --- a/cryptide_project/src/Pages/SignUpForm.tsx +++ b/cryptide_project/src/Pages/SignUpForm.tsx @@ -35,7 +35,7 @@ const SignUp = () => { setShowConfirmation(true); setTimeout(() => { - navigate(`${basePath}/login`); // 3 secondes avant de rediriger vers la page de connexion + navigate(`/${basePath}/login`); // 3 secondes avant de rediriger vers la page de connexion }, 1250); } } catch (error: any) {