1
0

Removed games/ part of game path

Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
James Ketrenos 2022-03-11 10:48:53 -08:00
parent aa08ae9d5a
commit 4c2acdc5dc
3 changed files with 15 additions and 10 deletions

View File

@ -215,7 +215,7 @@ const App = () => {
return (
<Router>
<Routes>
<Route exact element={<Table/>} path={`${base}/games/:gameId`}/>
<Route exact element={<Table/>} path={`${base}/:gameId`}/>
<Route exact element={<Table/>} path={`${base}`}/>
</Routes>
</Router>

View File

@ -27,7 +27,7 @@ const Board = () => {
const [ longestRoadLength, setLongestRoadLength ] = useState(0);
const fields = useMemo(() => [
'signature', 'robber', 'robberName',
'pips', 'pipsOrder', 'borders', 'borderOrder', 'tiles', 'tileOrder',
'pips', 'pipOrder', 'borders', 'borderOrder', 'tiles', 'tileOrder',
'placements', 'turn', 'state', 'color', 'longestRoadLength'
], []);
@ -100,6 +100,9 @@ const Board = () => {
}
const onResize = debounce(() => {
if (!board.current) {
return;
}
/* Adjust the 'transform: scale' for the BoardBox
* so the board fills the Board
*
@ -122,7 +125,7 @@ const Board = () => {
window.addEventListener('resize', onResize);
onResize();
return () => {
window.removeEventListener('resize', onResize);
}
@ -487,12 +490,14 @@ const Board = () => {
setTileElements(generateTiles());
setCornerElements(generateCorners());
setRoadElements(generateRoads());
}, [signature,
setPipElements, setBorderElements, setTileElements,
setCornerElements, setRoadElements,
borderImageWidth, radius, tileHalfHeight, tileHalfWidth,
borderImageHeight, borderOrder, borders, pipOrder, pips, robber, tileOrder, tiles,
tileHeight]);
}, [
signature,
setPipElements, setBorderElements, setTileElements,
setCornerElements, setRoadElements,
borderImageWidth, radius, tileHalfHeight, tileHalfWidth, tileHeight,
borderImageHeight,
borderOrder, borders, pipOrder, pips, robber, tileOrder, tiles
]);
if (turn) {
let nodes = document.querySelectorAll('.Active');

View File

@ -24,6 +24,6 @@ function debounce(fn, ms) {
const base = process.env.PUBLIC_URL;
const assetsPath = `${base}/assets`;
const gamesPath = `${base}/games`;
const gamesPath = `${base}`;
export { base, debounce, assetsPath, gamesPath, getPlayerName };