From 7a2d7f435f459d82836e0de2124f0e2097baecde Mon Sep 17 00:00:00 2001 From: djmil Date: Fri, 10 Nov 2023 13:28:18 +0100 Subject: [PATCH] small clenup --- webapp/src/container/Games.jsx | 10 +++++----- webapp/src/container/games/view/NewGame.jsx | 1 - webapp/src/context/{games.jsx => games.js} | 0 webapp/src/reducer/games.js | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) rename webapp/src/context/{games.jsx => games.js} (100%) diff --git a/webapp/src/container/Games.jsx b/webapp/src/container/Games.jsx index 31d3584..43da121 100644 --- a/webapp/src/container/Games.jsx +++ b/webapp/src/container/Games.jsx @@ -1,5 +1,5 @@ -import './Games.css'; import React from 'react'; +import { GamesContext } from '../context/games'; import { NavLink, Routes, Route } from 'react-router-dom'; import NewGame from './games/view/NewGame'; @@ -17,16 +17,16 @@ import Forward from './games/action/Forward'; import GameBoard from './games/GameBoard'; -import { GamesContext } from '../context/games'; +import './Games.css'; -export default function Games({ context, players }) { +export default function Games({ context: { games, dispatchGames, gamesApi }, players }) { return ( - +
- +
diff --git a/webapp/src/container/games/view/NewGame.jsx b/webapp/src/container/games/view/NewGame.jsx index 0069967..0ce7d3e 100644 --- a/webapp/src/container/games/view/NewGame.jsx +++ b/webapp/src/container/games/view/NewGame.jsx @@ -35,7 +35,6 @@ export default function NewGame({ players, onSelectPlayer }) { whitePlayer = ''; } - console.log("WhitePlayer", whitePlayer, "BlackPlayer", blackPlayer); onSelectPlayer(whitePlayer, blackPlayer); } diff --git a/webapp/src/context/games.jsx b/webapp/src/context/games.js similarity index 100% rename from webapp/src/context/games.jsx rename to webapp/src/context/games.js diff --git a/webapp/src/reducer/games.js b/webapp/src/reducer/games.js index 40c4954..854ef37 100644 --- a/webapp/src/reducer/games.js +++ b/webapp/src/reducer/games.js @@ -13,7 +13,7 @@ export const gamesInitialState = { export function gamesReducer(state, action) { switch (action.type) { - case 'next': + case 'next': return nextState(state, action); default: