Merge pull request 'prod-react-routing' (#48) from prod-routing into main

Reviewed-on: http://192.168.8.55:3000/HQLAx/CordaCheckers/pulls/48
This commit is contained in:
djmil 2023-12-02 02:12:41 +01:00
commit 6989f56366
5 changed files with 11 additions and 9 deletions

View File

@ -11,7 +11,7 @@ public class ReactAppController {
// This controller simply redirects all UI related routes // This controller simply redirects all UI related routes
// to index.html, allowing react and react-router to work its magic // to index.html, allowing react and react-router to work its magic
@GetMapping(value = { "", "/", "/games", "/games/new", "/games/proposal", "/games/active", "/games/archive", "/about","/leaderboard" }) @GetMapping(value = { "", "/", "/games", "/games/*", "/about","/leaderboard" })
@PutMapping("/error") @PutMapping("/error")
public String getIndex(HttpServletRequest inRequest) { public String getIndex(HttpServletRequest inRequest) {
return "/index.html"; return "/index.html";

2
webapp/.gitignore vendored
View File

@ -21,3 +21,5 @@
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
package-lock.json

View File

@ -9,7 +9,7 @@
"fsevents": "^2.3.3", "fsevents": "^2.3.3",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-router-dom": "^6.16.0", "react-router-dom": "^6.20.1",
"react-scripts": "^5.0.1", "react-scripts": "^5.0.1",
"web-vitals": "^3.5.0" "web-vitals": "^3.5.0"
}, },

View File

@ -9,7 +9,7 @@
name="description" name="description"
content="Web site created using create-react-app" content="Web site created using create-react-app"
/> />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> <!-- <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> -->
<!-- <!--
manifest.json provides metadata used when your web app is installed on a manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/

View File

@ -1,6 +1,6 @@
import React, { useContext, useEffect } from 'react'; import React, { useContext, useEffect } from 'react';
import { GamesStateContext, GamesGuideContext } from '../context/games'; import { GamesStateContext, GamesGuideContext } from '../context/games';
import { NavLink, Routes, Route } from 'react-router-dom'; import { Routes, Route, Link } from 'react-router-dom';
import NewGame from './games/NewGame'; import NewGame from './games/NewGame';
import { GameProposalSelector, ActiveGameSelector, GameArchiveSelector } from './games/GameSelector'; import { GameProposalSelector, ActiveGameSelector, GameArchiveSelector } from './games/GameSelector';
@ -48,10 +48,10 @@ function ViewSelector() {
return ( return (
<nav className='ViewSelector'> <nav className='ViewSelector'>
<div className='Container' > <div className='Container' >
<NavLink to='new'>New</NavLink> <Link to='new'>New</Link>
<NavLink to='proposal'>Proposal<Counter number={guide.awaiting.proposal} /></NavLink> <Link to='proposal'>Proposal<Counter number={guide.awaiting.proposal} /></Link>
<NavLink to='active' >Active<Counter number={guide.awaiting.active} /></NavLink> <Link to='active' >Active<Counter number={guide.awaiting.active} /></Link>
<NavLink to='archive' >Archive</NavLink> <Link to='archive' >Archive</Link>
</div> </div>
</nav> </nav>
) )