diff --git a/.drone.yml b/.drone.yml index 5855957..f8710ca 100644 --- a/.drone.yml +++ b/.drone.yml @@ -47,7 +47,7 @@ steps: password: from_secret: SECRET_REGISTRY_PASSWORD environment: - REACT_APP_BASE_PATH: "/containers/Crypteam-website" + BASEPATH: "/containers/Crypteam-website" #depends_on: [ build ] diff --git a/cryptide_project/Dockerfile b/cryptide_project/Dockerfile index 591738e..64757e5 100644 --- a/cryptide_project/Dockerfile +++ b/cryptide_project/Dockerfile @@ -30,3 +30,4 @@ EXPOSE 80 # Définissez ENTRYPOINT pour démarrer Nginx lorsque le conteneur est lancé ENTRYPOINT ["nginx", "-g", "daemon off;"] +# \ No newline at end of file diff --git a/cryptide_project/src/App.tsx b/cryptide_project/src/App.tsx index 73ce42d..c3a0ab6 100644 --- a/cryptide_project/src/App.tsx +++ b/cryptide_project/src/App.tsx @@ -41,10 +41,10 @@ import messagesEn from './Translations/en.json'; /* Gestion d' erreur */ import ErrorBoundary from './Error/ErrorBoundary'; import ErrorPage from './Error/ErrorPage'; - -const basePath = process.env.REACT_APP_BASE_PATH || ''; import DeducCheck from './Pages/DeducCheck'; +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; + const messages = { fr: messagesFr, en: messagesEn, diff --git a/cryptide_project/src/Components/GraphContainer.tsx b/cryptide_project/src/Components/GraphContainer.tsx index 83697dd..f16c253 100644 --- a/cryptide_project/src/Components/GraphContainer.tsx +++ b/cryptide_project/src/Components/GraphContainer.tsx @@ -67,8 +67,7 @@ let cptBug = 0 let cptUseEffect = 0 let testPlayers: Player[] = [] -const basePath = process.env.REACT_APP_BASE_PATH || ''; - +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; const MyGraphComponent: React.FC = ({onNodeClick, handleShowTurnBar, handleTurnBarTextChange, playerTouched, setPlayerTouched, changecptTour, solo, isDaily, isEasy, addToHistory, showLast, setNetwork, setNetworkEnigme, setPlayerIndex, askedWrong, setAskedWrong, importToPdf, setImportToPdf}) => { let cptTour: number = 0 @@ -1020,7 +1019,7 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS catch(error){ console.log(error); } - navigate(`${basePath}/endgame?solo=true+${isDaily}`) + navigate(`${basePath}/endgame?solo=true&daily=${isDaily}`) } } diff --git a/cryptide_project/src/Components/LobbyContainer.tsx b/cryptide_project/src/Components/LobbyContainer.tsx index 797cef5..edebe08 100644 --- a/cryptide_project/src/Components/LobbyContainer.tsx +++ b/cryptide_project/src/Components/LobbyContainer.tsx @@ -20,7 +20,7 @@ interface LobbyContainerProps { //? mettre un "nbplayermax" si le nombre de joueur max peut etre fixé ? } -const basePath = process.env.REACT_APP_BASE_PATH || ''; +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; const LobbyContainer: React.FC = ({roomNum, HeadPlayer, nbPlayer, setFirst, started}) => { const theme=useTheme(); diff --git a/cryptide_project/src/Components/NavBar.tsx b/cryptide_project/src/Components/NavBar.tsx index 5921026..bd94a74 100644 --- a/cryptide_project/src/Components/NavBar.tsx +++ b/cryptide_project/src/Components/NavBar.tsx @@ -25,8 +25,7 @@ import { useTheme } from '../Style/ThemeContext'; import { useAuth } from '../Contexts/AuthContext'; import { useNavigate } from 'react-router-dom'; -const basePath = process.env.REACT_APP_BASE_PATH || ''; - +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; // @ts-ignore function AppNavbar({changeLocale}) { @@ -53,13 +52,13 @@ function AppNavbar({changeLocale}) { diff --git a/cryptide_project/src/Error/ErrorPage.tsx b/cryptide_project/src/Error/ErrorPage.tsx index dc3da66..ad90cde 100644 --- a/cryptide_project/src/Error/ErrorPage.tsx +++ b/cryptide_project/src/Error/ErrorPage.tsx @@ -6,8 +6,7 @@ import './ErrorStyle.css'; import { FormattedMessage } from 'react-intl'; import { Button } from 'react-bootstrap'; -const basePath = process.env.REACT_APP_BASE_PATH || ''; - +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; //@ts-ignore function ErrorPage({ code = "", msg = "Something is wrong"}) { diff --git a/cryptide_project/src/Pages/Home.tsx b/cryptide_project/src/Pages/Home.tsx index bc28c69..3e4d9ae 100644 --- a/cryptide_project/src/Pages/Home.tsx +++ b/cryptide_project/src/Pages/Home.tsx @@ -13,6 +13,9 @@ import { socket } from '../SocketConfig'; import JSONParser from '../JSONParser'; +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; + + // @ts-ignore function Home() { const theme=useTheme(); @@ -100,7 +103,7 @@ function Home() { {/*


Kwanchai Moriya

*/} {/* */}
- { @@ -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..89cde23 100644 --- a/cryptide_project/src/Pages/Lobby.tsx +++ b/cryptide_project/src/Pages/Lobby.tsx @@ -50,8 +50,7 @@ import { DataSet } from 'vis-network'; let gameStarted = false let firstLaunch = true -const basePath = process.env.REACT_APP_BASE_PATH || ''; - +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; function Lobby() { const theme=useTheme(); diff --git a/cryptide_project/src/Pages/LoginForm.tsx b/cryptide_project/src/Pages/LoginForm.tsx index dde8427..0f7976d 100644 --- a/cryptide_project/src/Pages/LoginForm.tsx +++ b/cryptide_project/src/Pages/LoginForm.tsx @@ -5,7 +5,7 @@ import { useAuth } from '../Contexts/AuthContext'; import AuthService from '../services/AuthService'; import '../Style/Global.css'; -const basePath = process.env.REACT_APP_BASE_PATH || ''; +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; const SignIn = () => { const navigate = useNavigate(); diff --git a/cryptide_project/src/Pages/NewPlay.tsx b/cryptide_project/src/Pages/NewPlay.tsx index 8c658f1..38bb038 100644 --- a/cryptide_project/src/Pages/NewPlay.tsx +++ b/cryptide_project/src/Pages/NewPlay.tsx @@ -34,8 +34,7 @@ import Lobbies from './Lobbies'; let cptNavigation = 0 -const basePath = process.env.REACT_APP_BASE_PATH || ''; - +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; function NewPlay() { diff --git a/cryptide_project/src/Pages/Play.tsx b/cryptide_project/src/Pages/Play.tsx index e783f53..f0a80f3 100644 --- a/cryptide_project/src/Pages/Play.tsx +++ b/cryptide_project/src/Pages/Play.tsx @@ -32,8 +32,7 @@ import Info from '../res/icon/infoGreen.png'; let cptNavigation = 0 -const basePath = process.env.REACT_APP_BASE_PATH || ''; - +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; function Play() { let first = true diff --git a/cryptide_project/src/Pages/Profile.tsx b/cryptide_project/src/Pages/Profile.tsx index a59ad2e..73349b5 100644 --- a/cryptide_project/src/Pages/Profile.tsx +++ b/cryptide_project/src/Pages/Profile.tsx @@ -25,7 +25,7 @@ import Form from 'react-bootstrap/Form'; import ProgressBar from 'react-bootstrap/ProgressBar'; -const basePath = process.env.REACT_APP_BASE_PATH || ''; +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; //@ts-ignore const Profile = () => { diff --git a/cryptide_project/src/Pages/SignUpForm.tsx b/cryptide_project/src/Pages/SignUpForm.tsx index 9e29449..b1dac73 100644 --- a/cryptide_project/src/Pages/SignUpForm.tsx +++ b/cryptide_project/src/Pages/SignUpForm.tsx @@ -4,7 +4,7 @@ import { useNavigate } from 'react-router-dom'; import AuthService from '../services/AuthService'; import '../Style/Global.css'; -const basePath = process.env.REACT_APP_BASE_PATH || ''; +const basePath = process.env.REACT_APP_BASE_PATH || '/containers/Crypteam-website'; const SignUp = () => {