prod-react-routing #48
@ -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
2
webapp/.gitignore
vendored
@ -21,3 +21,5 @@
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
package-lock.json
|
@ -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"
|
||||
},
|
||||
|
@ -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/
|
||||
|
@ -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';
|
||||
@ -46,12 +46,12 @@ function ViewSelector() {
|
||||
const guide = useContext(GamesGuideContext);
|
||||
|
||||
return (
|
||||
<nav className='ViewSelector' >
|
||||
<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>
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user