small clenup
This commit is contained in:
parent
7acad9b0f3
commit
7a2d7f435f
@ -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 />
|
||||
|
@ -35,7 +35,6 @@ export default function NewGame({ players, onSelectPlayer }) {
|
||||
whitePlayer = '';
|
||||
}
|
||||
|
||||
console.log("WhitePlayer", whitePlayer, "BlackPlayer", blackPlayer);
|
||||
onSelectPlayer(whitePlayer, blackPlayer);
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ export const gamesInitialState = {
|
||||
export function gamesReducer(state, action) {
|
||||
switch (action.type) {
|
||||
|
||||
case 'next':
|
||||
case 'next':
|
||||
return nextState(state, action);
|
||||
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user