Fix broken component descriptor

This commit is contained in:
Manuel Thalmann 2022-12-15 22:14:47 +01:00
parent 5ce44a8d93
commit 608ec9c72a
2 changed files with 5 additions and 4 deletions

View file

@ -9,13 +9,13 @@ const undoClass = "undo-game";
/** /**
* Gets a component which represents the specified {@link game `game`}. * Gets a component which represents the specified {@link game `game`}.
* *
* @param {import("./Game.js").Game} game * @param {{game: import("./Game.js").Game }} game
* The game represented in this app. * The game represented in this app.
* *
* @returns {NodeDescriptor} * @returns {NodeDescriptor}
* The rendered node. * The rendered node.
*/ */
export function App(game) export function App({ game })
{ {
return [ return [
"div", "div",
@ -91,6 +91,7 @@ export function App(game)
*/ */
export function Board({ board }) export function Board({ board })
{ {
console.log(board);
let fields = board.flatMap((row) => row); let fields = board.flatMap((row) => row);
return [ return [

View file

@ -1,6 +1,6 @@
import { App } from "./Components.js"; import { App } from "./Components.js";
import { State } from "./State.js"; import { State } from "./State.js";
import { SuiWeb } from "./SuiWeb.js"; import { render } from "./SuiWeb.js";
/** /**
* Represents a game. * Represents a game.
@ -192,7 +192,7 @@ export class Game
{ {
let container = document.getElementById(this.id); let container = document.getElementById(this.id);
container.innerHTML = ""; container.innerHTML = "";
SuiWeb.render([App, this], container); render([App, { game: this }], container);
} }
/** /**