small clenup

This commit is contained in:
djmil 2023-11-10 13:28:18 +01:00
parent 7acad9b0f3
commit 7a2d7f435f
4 changed files with 6 additions and 7 deletions

View File

@ -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 (
<GamesContext.Provider value={context.games} >
<GamesContext.Provider value={games} >
<div className='Games'>
<div className='left-side'>
<ViewSelector />
<ViewProvider players={players} dispatchGames={context.dispatchGames} />
<ViewProvider players={players} dispatchGames={dispatchGames} />
</div>
<div className='right-side'>
<ActionPanel />

View File

@ -35,7 +35,6 @@ export default function NewGame({ players, onSelectPlayer }) {
whitePlayer = '';
}
console.log("WhitePlayer", whitePlayer, "BlackPlayer", blackPlayer);
onSelectPlayer(whitePlayer, blackPlayer);
}

View File

@ -13,7 +13,7 @@ export const gamesInitialState = {
export function gamesReducer(state, action) {
switch (action.type) {
case 'next':
case 'next':
return nextState(state, action);
default: