diff --git a/webapp/src/App.js b/webapp/src/App.js index c0f7a11..8bda870 100644 --- a/webapp/src/App.js +++ b/webapp/src/App.js @@ -16,6 +16,7 @@ function App() { {/* https://stackoverflow.com/questions/40541994/multiple-path-names-for-a-same-component-in-react-router */} } /> + } /> } /> } /> } /> diff --git a/webapp/src/components/Game/GameAction.jsx b/webapp/src/components/Game/GameAction.jsx index 435b853..8cdbcf9 100644 --- a/webapp/src/components/Game/GameAction.jsx +++ b/webapp/src/components/Game/GameAction.jsx @@ -1,24 +1,45 @@ import './GameAction.css'; import React from 'react'; +import { useLocation, matchPath } from "react-router"; + +import Create from './GameAction/Create'; + +import Reject from './GameAction/Reject'; +import Cancel from './GameAction/Cancel'; +import Accept from './GameAction/Accept'; + +import DrawReq from './GameAction/DrawReq'; +import DrawAcq from './GameAction/DrawAcq'; +import Surrender from './GameAction/Surrender'; + +import Backward from './GameAction/Backward'; +import Forward from './GameAction/Forward'; -import Create from './GameAction/Create' -import Reject from './GameAction/Reject' -import Cancel from './GameAction/Cancel' -import Accept from './GameAction/Accept' // import { AppContext } from '../../context/app' export default function GameAction() { // const [ctx, dispatchCtx] = React.useContext(AppContext) + const { pathname } = useLocation(); + const isNewGamePath = matchPath("/game/new", pathname); + const isProposalPath = matchPath("/game/proposal/*", pathname); + const isActivelPath = matchPath("/game/active/*", pathname); + const isArchivePath = matchPath("/game/archive/*", pathname); + return ( -
-
- - - - -
- {/* {isProposalPath && } */} +
+ {isNewGamePath && } + + {isProposalPath && } + {isProposalPath && } + {isProposalPath && } + + {isActivelPath && } + {isActivelPath && } + {isActivelPath && } + + {isArchivePath && } + {isArchivePath && }
) } \ No newline at end of file diff --git a/webapp/src/components/Game/GameAction/Backward.jsx b/webapp/src/components/Game/GameAction/Backward.jsx new file mode 100644 index 0000000..2cebb00 --- /dev/null +++ b/webapp/src/components/Game/GameAction/Backward.jsx @@ -0,0 +1,6 @@ +import React from 'react'; + +export default function Backward() { + + return +} diff --git a/webapp/src/components/Game/GameAction/DrawAcq.jsx b/webapp/src/components/Game/GameAction/DrawAcq.jsx new file mode 100644 index 0000000..5d1a5af --- /dev/null +++ b/webapp/src/components/Game/GameAction/DrawAcq.jsx @@ -0,0 +1,6 @@ +import React from 'react'; + +export default function DrawAcq() { + + return +} diff --git a/webapp/src/components/Game/GameAction/DrawReq.jsx b/webapp/src/components/Game/GameAction/DrawReq.jsx new file mode 100644 index 0000000..33f147e --- /dev/null +++ b/webapp/src/components/Game/GameAction/DrawReq.jsx @@ -0,0 +1,6 @@ +import React from 'react'; + +export default function DrawReq() { + + return +} diff --git a/webapp/src/components/Game/GameAction/Forward.jsx b/webapp/src/components/Game/GameAction/Forward.jsx new file mode 100644 index 0000000..a9f5380 --- /dev/null +++ b/webapp/src/components/Game/GameAction/Forward.jsx @@ -0,0 +1,6 @@ +import React from 'react'; + +export default function Forward() { + + return +} diff --git a/webapp/src/components/Game/GameAction/Surrender.jsx b/webapp/src/components/Game/GameAction/Surrender.jsx new file mode 100644 index 0000000..fb53cb4 --- /dev/null +++ b/webapp/src/components/Game/GameAction/Surrender.jsx @@ -0,0 +1,6 @@ +import React from 'react'; + +export default function Surrender() { + + return +} diff --git a/webapp/src/components/Game/GameHeader.jsx b/webapp/src/components/Game/GameHeader.jsx index 4b9ffe9..b2ae0b1 100644 --- a/webapp/src/components/Game/GameHeader.jsx +++ b/webapp/src/components/Game/GameHeader.jsx @@ -6,6 +6,7 @@ export default function GameHeader() { return (