small clenup
This commit is contained in:
parent
7acad9b0f3
commit
7a2d7f435f
@ -1,5 +1,5 @@
|
|||||||
import './Games.css';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { GamesContext } from '../context/games';
|
||||||
import { NavLink, Routes, Route } from 'react-router-dom';
|
import { NavLink, Routes, Route } from 'react-router-dom';
|
||||||
|
|
||||||
import NewGame from './games/view/NewGame';
|
import NewGame from './games/view/NewGame';
|
||||||
@ -17,16 +17,16 @@ import Forward from './games/action/Forward';
|
|||||||
|
|
||||||
import GameBoard from './games/GameBoard';
|
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 (
|
return (
|
||||||
<GamesContext.Provider value={context.games} >
|
<GamesContext.Provider value={games} >
|
||||||
<div className='Games'>
|
<div className='Games'>
|
||||||
<div className='left-side'>
|
<div className='left-side'>
|
||||||
<ViewSelector />
|
<ViewSelector />
|
||||||
<ViewProvider players={players} dispatchGames={context.dispatchGames} />
|
<ViewProvider players={players} dispatchGames={dispatchGames} />
|
||||||
</div>
|
</div>
|
||||||
<div className='right-side'>
|
<div className='right-side'>
|
||||||
<ActionPanel />
|
<ActionPanel />
|
||||||
|
@ -35,7 +35,6 @@ export default function NewGame({ players, onSelectPlayer }) {
|
|||||||
whitePlayer = '';
|
whitePlayer = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("WhitePlayer", whitePlayer, "BlackPlayer", blackPlayer);
|
|
||||||
onSelectPlayer(whitePlayer, blackPlayer);
|
onSelectPlayer(whitePlayer, blackPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ export const gamesInitialState = {
|
|||||||
export function gamesReducer(state, action) {
|
export function gamesReducer(state, action) {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
|
|
||||||
case 'next':
|
case 'next':
|
||||||
return nextState(state, action);
|
return nextState(state, action);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user