Skip to content

Commit

Permalink
Merge pull request #65 from Arquisoft/fix-questions-front
Browse files Browse the repository at this point in the history
Game refactoring
  • Loading branch information
pelazas authored Mar 25, 2024
2 parents 2d65837 + 7e8bbde commit 8b5e994
Show file tree
Hide file tree
Showing 18 changed files with 433 additions and 150 deletions.
256 changes: 255 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"react-query": "^3.39.3"
}
}
3 changes: 2 additions & 1 deletion webapp/.env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
REACT_APP_API_ENDPOINT=http://74.234.241.249
http://74.234.241.249
REACT_APP_API_ENDPOINT=http://localhost:8000
8 changes: 4 additions & 4 deletions webapp/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { BrowserRouter } from "react-router-dom";
import { AppRouter } from "./Router";



/** The old code is not in /pages/init/index.tsx and is shown as default */
function App() {


return (
<BrowserRouter>
<AppRouter />
</BrowserRouter>
<BrowserRouter>
<AppRouter />
</BrowserRouter>
);
}

Expand Down
4 changes: 4 additions & 0 deletions webapp/src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { RouterLayout } from "./common/RouterLayout";
import { InitPage } from "./pages/init";
import { ScoreboardPage } from "./pages/scoreboard";
import ProfilePage from "./pages/userProfile";
import GameSinglePlayer from "./components/game/GameSinglePlayer";
import GameMultiPlayer from "./components/game/GameMultiPlayer";

export const AppRouter: React.FC<{}> = () => {
return (
Expand All @@ -14,6 +16,8 @@ export const AppRouter: React.FC<{}> = () => {
{ /* When accessing /game or the other paths, it will be shown as the
outlet inside RouterLayout*/ }
<Route path="/game" element={<GamePage />} />
<Route path="/game/single-player" element={<GameSinglePlayer />} />
<Route path="/game/multi-player" element={<GameMultiPlayer />} />
<Route path="/groups" element={<GroupsPage />} />
<Route path="/scoreboard" element={<ScoreboardPage />} />
<Route path="/profile" element={<ProfilePage />} />
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/game-layout/GameLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from "react";
import Game from "../game/Game";
import Game from "../game/GameSinglePlayer";
import Group from "../group/Group";
import Scoreboard from "../scoreboard/Scoreboard";

Expand Down
Loading

0 comments on commit 8b5e994

Please sign in to comment.