You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
607 B

require('../../sass/board/grid.scss');
import { Component } from 'react';
import GridCell from './grid-cell.component';
import { SETTINGS } from '../../App';
export default class Grid extends Component {
render() {
const { values } = this.props.values;
const cells = [];
this.props.values.map((v, i) => {
const x = i % SETTINGS.GRID_WIDTH;
const y = Math.floor(i / SETTINGS.GRID_WIDTH);
cells.push(<GridCell value={v.value} show={v.show} x={x} y={y} key={i} />);
});
return (<div className='grid'>{cells}</div>);
};
};