Prettier & slight fix

Streamlined DummyGrid to behave like Grid.

Fixed a bad practice issue with ActiveFragmentSummary that displayed an error message in the webbrowser devtool console.
This commit is contained in:
borisflagell 2022-05-22 01:08:53 +02:00
parent ce5fdb00af
commit 5b4addbb21
3 changed files with 2 additions and 4 deletions

@ -66,7 +66,7 @@ export function ActiveFragmentSummary(props: IProps): React.ReactElement {
</TableRow>
{summary.map((entry) => {
return (
<TableRow>
<TableRow key={entry.type}>
<TableCell sx={{ borderBottom: "none", p: 0, m: 0 }}>
<Typography>
{entry.coordinate.map((coord) => {

@ -13,7 +13,6 @@ interface IProps {
export function DummyGrid(props: IProps): React.ReactElement {
const gift = new DummyGift(props.width, props.height, props.fragments);
const activeGrid = calculateGrid(gift);
const ghostGrid = zeros([props.width, props.height]);
return (
<Box>
@ -21,7 +20,6 @@ export function DummyGrid(props: IProps): React.ReactElement {
<Grid
width={props.width}
height={props.height}
activeGrid={activeGrid}
ghostGrid={ghostGrid}
gift={gift}
enter={() => undefined}

@ -32,7 +32,7 @@ function randomColor(fragment: ActiveFragment): string {
}
export function Grid(props: IProps): React.ReactElement {
const activeGrid = calculateGrid(props.gift)
const activeGrid = calculateGrid(props.gift);
function color(worldX: number, worldY: number): string {
if (props.ghostGrid[worldX][worldY] && activeGrid[worldX][worldY]) return "red";