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
// 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")
public String getIndex(HttpServletRequest inRequest) {
return "/index.html";

2
webapp/.gitignore vendored
View File

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

View File

@ -9,7 +9,7 @@
"fsevents": "^2.3.3",
"react": "^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",
"web-vitals": "^3.5.0"
},

View File

@ -9,7 +9,7 @@
name="description"
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
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 { 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 { GameProposalSelector, ActiveGameSelector, GameArchiveSelector } from './games/GameSelector';
@ -48,10 +48,10 @@ function ViewSelector() {
return (
<nav className='ViewSelector'>
<div className='Container' >
<NavLink to='new'>New</NavLink>
<NavLink to='proposal'>Proposal<Counter number={guide.awaiting.proposal} /></NavLink>
<NavLink to='active' >Active<Counter number={guide.awaiting.active} /></NavLink>
<NavLink to='archive' >Archive</NavLink>
<Link to='new'>New</Link>
<Link to='proposal'>Proposal<Counter number={guide.awaiting.proposal} /></Link>
<Link to='active' >Active<Counter number={guide.awaiting.active} /></Link>
<Link to='archive' >Archive</Link>
</div>
</nav>
)