revert 53ac430987
continuous-integration/drone/push Build is passing Details

revert fix /
master
Thomas CHAZOT 7 months ago
parent 53ac430987
commit 547f02227f

@ -89,19 +89,19 @@ function App() {
{hasNavbarVisible && <AppNavbar changeLocale={changeLocale} locale={locale} />}
<Routes>
<Route path={``} element={<NewPlay/>} />
<Route path={`login`} element={<Login />} />
<Route path={`signup`} element={<SignUp />} />
<Route path={`presentation`} element={<Home />} />
<Route path={`lobby`} element={<Lobby/>} />
<Route path={`endgame`} element={<EndGame lang={locale}/>} />
<Route path={`game`} element={<InGame locale={locale} changeLocale={changeLocale}/>}/>
<Route path={`info`} element={<InfoPage locale={locale} changeLocale={changeLocale}/>} />
<Route path={`tutorial`} element={<Tutorial locale={locale} changeLocale={changeLocale}/>} />
<Route path={`deduc`} element={<DeducCheck lang={locale}/>} />
<Route path={`TheRealDeduc`} element={<DeducGrid/>} />
<Route path={`profile`} element={<Profile/>} />
<Route path={`join`} element={<Lobbies/>}/>
<Route path={`${basePath}/`} element={<NewPlay/>} />
<Route path={`${basePath}/login`} element={<Login />} />
<Route path={`${basePath}/signup`} element={<SignUp />} />
<Route path={`${basePath}/presentation`} element={<Home />} />
<Route path={`${basePath}/lobby`} element={<Lobby/>} />
<Route path={`${basePath}/endgame`} element={<EndGame lang={locale}/>} />
<Route path={`${basePath}/game`} element={<InGame locale={locale} changeLocale={changeLocale}/>}/>
<Route path={`${basePath}/info`} element={<InfoPage locale={locale} changeLocale={changeLocale}/>} />
<Route path={`${basePath}/tutorial`} element={<Tutorial locale={locale} changeLocale={changeLocale}/>} />
<Route path={`${basePath}/deduc`} element={<DeducCheck lang={locale}/>} />
<Route path={`${basePath}/TheRealDeduc`} element={<DeducGrid/>} />
<Route path={`${basePath}/profile`} element={<Profile/>} />
<Route path={`${basePath}/join`} element={<Lobbies/>}/>
{/* <Route path="/solo" element={<SoloGame locale={locale} changeLocale={changeLocale} />}/> */}
<Route path="*" element={<ErrorPage code="404" msg='not found' />} /> {/* page 404 */}

@ -17,7 +17,7 @@ function BigButtonNav({ dest, img}) {
// };
return (
<Link to={`${dest}`} className="link-without-underline">
<Link to={`${basePath}/${dest}`} className="link-without-underline">
<button className='bigbuttonNabImg' style={{ backgroundColor: theme.colors.primary }}>
<img src={img} alt="Button Image" height="100" width="100"/>
</button>

@ -11,7 +11,7 @@ import {basePath} from "../AdressSetup"
function ButtonImgNav({ dest, img, text = "" }) {
const theme = useTheme();
return (
<Link to={`${dest}`} className="link-without-underline"> {/*target='_blank' ==> ouvre un nouvelle onglet*/ }
<Link to={`${basePath}/${dest}`} className="link-without-underline"> {/*target='_blank' ==> ouvre un nouvelle onglet*/ }
<button className='buttonNabImg' style={{ backgroundColor: theme.colors.primary, color: theme.colors.secondary}}>
<img src={img} alt="Button Image" height="50" width="50"/>
<p>{text}</p>

@ -939,7 +939,7 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
socket.off("asked")
socket.off("who plays")
navigate(`endgame`)
navigate(`${basePath}/endgame`)
}
}
})
@ -1137,12 +1137,12 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
testFirst = true
setElapsedTime(0)
endgame = true
navigate(`endgame?solo=true&daily=${isDaily}`)
navigate(`${basePath}/endgame?solo=true&daily=${isDaily}`)
}
catch(error){
console.log(error);
}
navigate(`endgame?solo=true&daily=${isDaily}`)
navigate(`${basePath}/endgame?solo=true&daily=${isDaily}`)
}
else{
if (isDaily){
@ -1157,7 +1157,7 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
changecptTour(cptTour); // On le transmet a la page précédente avec la fonction
}
else{
navigate(`endgame?solo=true&daily=true`)
navigate(`${basePath}/endgame?solo=true&daily=true`)
setNetworkDataData(networkData)
setWinnerData(null)
}

@ -49,7 +49,7 @@ const LobbyContainer: React.FC<LobbyContainerProps> = ({roomNum, HeadPlayer, nbP
if (nbPlayer < 6 && !started) {
socket.off("request lobbies")
setFirst(true)
navigate(`${dest}`);
navigate(`${basePath}/${dest}`);
}
else if(started){
handleShowStart()

@ -37,15 +37,15 @@ function AppNavbar({changeLocale, locale}) {
const {isLoggedIn, login, user, setUserData, manager } = useAuth();
function navigateToProfile(){
navigate(`profile`)
navigate(`${basePath}/profile`)
}
function navigateToLogin(){
navigate(`login`)
navigate(`${basePath}/login`)
}
function navigateToHome(){
navigate(``)
navigate(`${basePath}/`)
}
return (
@ -57,13 +57,13 @@ function AppNavbar({changeLocale, locale}) {
<Navbar.Toggle aria-controls="basic-navbar-nav" />
<Navbar.Collapse id="basic-navbar-nav">
<Nav className="me-auto">
<Nav.Link href={``} style={{ color: theme.colors.text }}>
<Nav.Link href={`${basePath}/`} style={{ color: theme.colors.text }}>
<FormattedMessage id="navbar.play" />
</Nav.Link>
<Nav.Link href={`presentation`} style={{ color: theme.colors.text }}>
<Nav.Link href={`${basePath}/presentation`} style={{ color: theme.colors.text }}>
<FormattedMessage id="navbar.presentation" />
</Nav.Link>
<Nav.Link href={`info`} style={{ color: theme.colors.text }}>
<Nav.Link href={`${basePath}/info`} style={{ color: theme.colors.text }}>
<FormattedMessage id="navbar.info" />
</Nav.Link>
</Nav>

@ -305,7 +305,7 @@ const TutorialGraph: React.FC<TutorialGraphProps> = ({showLast, setNetwork, setP
setPlayerTouched(-1)
setWinnerData(winner)
first = true
navigate(`endgame`)
navigate(`${basePath}/endgame`)
}
}
}

@ -28,7 +28,7 @@ function ErrorPage({ code = "", msg = "Something is wrong"}) {
</div>
<div className='centerDivH' style={{margin: "20px"}}>
<Button href={``} variant='danger'><FormattedMessage id='BackHome'/></Button>
<Button href={`${basePath}/`} variant='danger'><FormattedMessage id='BackHome'/></Button>
</div>
</div>
);

@ -181,7 +181,7 @@ function EndGame({lang}: {lang: string}) {
</Row>
<Row className="justify-content-md-center">
<Button href={``} style={{
<Button href={`${basePath}/`} style={{
width:"50%",
margin:"10px"
}}>Retour à l'accueil</Button>
@ -259,7 +259,7 @@ function EndGame({lang}: {lang: string}) {
<Row className="justify-content-md-center">
<Button href={``} style={{
<Button href={`${basePath}/`} style={{
width:"50%",
margin:"10px"
}}>Retour à l'accueil</Button>
@ -322,7 +322,7 @@ function EndGame({lang}: {lang: string}) {
</Row>
<Row className='justify-content-center'>
<Button href={``} style={{
<Button href={`${basePath}/`} style={{
width:"50%",
margin:"10px"
}}>Retour à l'accueil</Button>

@ -83,7 +83,7 @@ function Home() {
Si un joueur place un jeton carré, le questionneur doit également jouer son jeu en plaçant un jeton carré de sa couleur sur un nœud du graphique. La contre-manipulation devient ainsi une arme redoutable pour détourner l'accusation et semer la confusion. Pour en savoir plus, plongez-vous dans les détails de ce passionnant récit sur une autre page.
</p>
<h5>Pour des informations plus détaillées, consulter les <Link to={`info`}>règles</Link>.</h5>
<h5>Pour des informations plus détaillées, consulter les <Link to={`${basePath}/info`}>règles</Link>.</h5>
<hr/>
</div>
@ -116,7 +116,7 @@ function Home() {
{/* <button>Jouer au jeu</button> */}
<br/>
<Link to={``} className='button'
<Link to={`${basePath}/`} className='button'
style={{
backgroundColor: theme.colors.primary,
borderColor: theme.colors.secondary

@ -73,7 +73,7 @@ const InGame = ({locale, changeLocale}) => {
if (cptNavigation % 2 == 0){
if (navigationType.toString() == "POP"){
socket.emit("player quit")
navigate(``)
navigate(`${basePath}/`)
}
}
@ -513,7 +513,7 @@ const handleBlurIndice = () => {
{/* <Link to='/info#indice-possible' target='_blank'>
//? redirection impossible apparament (securité des navigateur
*/}
<Link to={`info`} target='_blank'>
<Link to={`${basePath}/info`} target='_blank'>
<button className='button'
style={{
backgroundColor: theme.colors.tertiary,
@ -524,7 +524,7 @@ const handleBlurIndice = () => {
</Link>
{!IsSolo &&
<Link to={`${navdeduc}`} target='_blank'>
<Link to={`${basePath}/${navdeduc}`} target='_blank'>
<button className='button'
style={{
backgroundColor: theme.colors.tertiary,
@ -650,7 +650,7 @@ const handleBlurIndice = () => {
<div className='centerDivH' style={{margin: "20px"}}>
<Button variant="outline-warning" onClick={() => {setHistory([]); changeGraph(enteredNumber, enteredNumberIndices)}}><FormattedMessage id='regenerate'/></Button>
</div>
<Button variant="outline-danger" href={``}><FormattedMessage id='BackHome'/></Button>
<Button variant="outline-danger" href={`${basePath}/`}><FormattedMessage id='BackHome'/></Button>
</div>
</Offcanvas.Body>
</Offcanvas>

@ -144,7 +144,7 @@ function Lobby() {
gameStarted = true
//socket.off("player left")
//socket.off("new player")
navigate(`game?solo=false&daily=false`);
navigate(`${basePath}/game?solo=false&daily=false`);
});
@ -181,7 +181,7 @@ function Lobby() {
setGameStartData(true)
first = true
gameStarted = true
navigate(`game?solo=false&daily=false`)
navigate(`${basePath}/game?solo=false&daily=false`)
});
socket.on("new player", (tab) =>{
@ -194,15 +194,15 @@ function Lobby() {
});
socket.on("room full", () => {
navigate(``)
navigate(`${basePath}/`)
})
socket.on("game started", () => {
navigate(``)
navigate(`${basePath}/`)
})
socket.on("game already started", () => {
navigate(``)
navigate(`${basePath}/`)
})
socket.on("player left", (tab, i) => {

@ -37,7 +37,7 @@ const SignIn = () => {
setShowConfirmation(true);
setTimeout(async () => {
await login();
navigate(``);
navigate(`${basePath}/`);
}, 1250);
}
} catch (error: any) {
@ -80,7 +80,7 @@ const SignIn = () => {
</button>
</div>
<p className="forgot-password text-right">
<Link to={`signup`}>Pas encore inscrit ?</Link>
<Link to={`${basePath}/signup`}>Pas encore inscrit ?</Link>
</p>
</form>

@ -102,7 +102,7 @@ function NewPlay() {
setIndicesData(choosenIndices)
setIndicesData(choosenIndices)
setGameStartData(true)
navigate(`game?solo=true&daily=false`);
navigate(`${basePath}/game?solo=true&daily=false`);
}
@ -115,7 +115,7 @@ function NewPlay() {
}
function launchTuto(){
navigate(`tutorial`);
navigate(`${basePath}/tutorial`);
}
@ -142,7 +142,7 @@ function NewPlay() {
}, [room, navigate]);
const goBack = () => {
navigate(`lobby?room=${goBackRoom}`)
navigate(`${basePath}/lobby?room=${goBackRoom}`)
}
@ -165,7 +165,7 @@ function NewPlay() {
setIndicesData(choosenIndices)
setIndicesData(choosenIndices)
setGameStartData(true)
navigate(`game?solo=true&daily=true&difficulty=easy`);
navigate(`${basePath}/game?solo=true&daily=true&difficulty=easy`);
setShowOverlay(false);
};
@ -180,7 +180,7 @@ function NewPlay() {
setGameStartData(true)
navigate(`game?solo=true&daily=true&difficulty=intermediate`);
navigate(`${basePath}/game?solo=true&daily=true&difficulty=intermediate`);
if (first){
first = false
const map = EnigmeDuJourCreator.createEnigme(networkPerson, choosenIndices, choosenPerson, Stub.GenerateIndice())
@ -203,7 +203,7 @@ function NewPlay() {
const map = EnigmeDuJourCreator.createEnigme(networkPerson, choosenIndices, choosenPerson, Stub.GenerateIndice())
setDailyEnigmeData(map)
}
navigate(`game?solo=true&daily=true&difficulty=hard`);
navigate(`${basePath}/game?solo=true&daily=true&difficulty=hard`);
setShowOverlay(false);
};

@ -100,7 +100,7 @@ function Play() {
setPersonNetworkData(networkPerson)
setIndicesData(choosenIndices)
setIndicesData(choosenIndices)
navigate(`game?solo=true&daily=false`);
navigate(`${basePath}/game?solo=true&daily=false`);
}
@ -136,7 +136,7 @@ function Play() {
}, [room, navigate]);
const goBack = () => {
navigate(`lobby?room=${goBackRoom}`)
navigate(`${basePath}/lobby?room=${goBackRoom}`)
}
@ -159,7 +159,7 @@ function Play() {
setIndicesData(choosenIndices)
setIndicesData(choosenIndices)
navigate(`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(`game?solo=true&daily=true&easy=false`);
navigate(`${basePath}/game?solo=true&daily=true&easy=false`);
setShowOverlay(false);
};
@ -240,7 +240,7 @@ function Play() {
<button onClick={createLobby} className="ButtonNav" style={{backgroundColor: theme.colors.primary, borderColor: theme.colors.secondary}}> Créer une partie </button>
<button onClick= {() => navigate(`join`)} className="ButtonNav" style={{backgroundColor: theme.colors.primary, borderColor: theme.colors.secondary}}> Rejoindre </button>
<button onClick= {() => navigate(`${basePath}/join`)} className="ButtonNav" style={{backgroundColor: theme.colors.primary, borderColor: theme.colors.secondary}}> Rejoindre </button>
</div>
</div>
<div className='rightContainer'>

@ -48,7 +48,7 @@ const Profile = () => {
const handleLogout = () => {
logout();
navigate(``);
navigate(`${basePath}/`);
};
// @ts-ignore
@ -200,7 +200,7 @@ const Profile = () => {
}
handleCloseDeleteModal();
navigate(``)
navigate(`${basePath}/`)
} else {
console.error('Phrase de confirmation incorrecte.');

@ -34,7 +34,7 @@ const SignUp = () => {
setShowConfirmation(true);
setTimeout(() => {
navigate(`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) {
@ -91,7 +91,7 @@ const SignUp = () => {
</button>
</div>
<p className="forgot-password text-right">
Vous avez déjà un <a href={`login`}>compte</a> ?
Vous avez déjà un <a href={`${basePath}/login`}>compte</a> ?
</p>
</form>

@ -82,7 +82,7 @@ const Tutorial = ({locale, changeLocale}) => {
if (cptNavigation % 2 == 0){
if (navigationType.toString() == "POP"){
socket.emit("player quit")
navigate(``)
navigate(`${basePath}/`)
}
}
@ -365,7 +365,7 @@ const Tutorial = ({locale, changeLocale}) => {
<Button variant="primary" onClick={handleShowHelp}>
<FormattedMessage id='aide'/>
</Button>
<Link to={`info`} target='_blank'>
<Link to={`${basePath}/info`} target='_blank'>
<button className='button'
style={{
backgroundColor: theme.colors.tertiary,

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save