diff --git a/webapp/src/App.js b/webapp/src/App.js index c2cb1c7..e83c0e3 100644 --- a/webapp/src/App.js +++ b/webapp/src/App.js @@ -6,7 +6,6 @@ import Header from "./components/Header" import Leaderboard from "./components/Leaderboard" import Game from "./components/Game" import About from "./components/About" -import GameProposal from './components/Game/Proposal' function App() { @@ -15,10 +14,13 @@ function App() {
- } /> } /> + } /> + } /> + } /> + + } /> } /> - } />
diff --git a/webapp/src/components/GameSelector/index.jsx b/webapp/src/components/GameSelector/index.jsx index fdd34c5..af4ff88 100644 --- a/webapp/src/components/GameSelector/index.jsx +++ b/webapp/src/components/GameSelector/index.jsx @@ -1,11 +1,19 @@ import './index.css'; import React from 'react'; +import { useLocation, matchPath } from "react-router"; import { AppData } from "../../context/data" export default function Game() { const [data] = React.useContext(AppData) +const { pathname } = useLocation(); +const isProposalPath = matchPath("/game/proposal/*", pathname); +const isActivelPath = matchPath("/game/active/*", pathname); +const isArchivePath = matchPath("/game/archive/*", pathname); + +console.log("path: Proposal ", isProposalPath != null, "Active", isActivelPath != null, "Archive", isArchivePath != null ) + if (!data?.games) return
Loading..