chg: dev: more, massive refactor for front-end #4
This commit is contained in:
@@ -2,13 +2,13 @@ import React from 'react';
|
||||
import { useGame } from '../../contexts/GameContext';
|
||||
import GridField from './GridField';
|
||||
import UserControl from '../user/UserControl';
|
||||
import { BOMB_SYMBOLS, bombRadius } from '../../constants';
|
||||
import { BOMB_SYMBOLS, bombRadius } from '../../utils/constants';
|
||||
|
||||
const GridControl = ({ onClick, resign }) => {
|
||||
const {
|
||||
overlay, overlayTitle, overlaySubTitle,
|
||||
webPlayer, activePlayer, mines, foundMines, bombSelected,
|
||||
red, blue, cells, setCells, onBombToggle,
|
||||
webPlayer, activePlayer, bombSelected,
|
||||
cells, setCells,
|
||||
} = useGame();
|
||||
|
||||
const handleHover = (row, col) => {
|
||||
@@ -39,13 +39,6 @@ const GridControl = ({ onClick, resign }) => {
|
||||
</div>
|
||||
</div>
|
||||
<UserControl
|
||||
webPlayer={webPlayer}
|
||||
activePlayer={activePlayer}
|
||||
mines={mines}
|
||||
foundMines={foundMines}
|
||||
red={red}
|
||||
blue={blue}
|
||||
onBombToggle={onBombToggle}
|
||||
resign={resign}
|
||||
/>
|
||||
<div className="grid-container">
|
||||
@@ -58,7 +51,7 @@ const GridControl = ({ onClick, resign }) => {
|
||||
onClick={() => onClick([r, c])}
|
||||
onMouseEnter={() => handleHover(r, c)}
|
||||
/>
|
||||
))
|
||||
)),
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user