From e5b2e4139e1a88e96da5ce02eb205b6bd68028de Mon Sep 17 00:00:00 2001 From: Joel Therrien Date: Fri, 15 Sep 2023 20:37:40 -0700 Subject: [PATCH] Clean up UI code --- ui/src/Game.tsx | 4 ++-- ui/src/Menu.tsx | 2 +- ui/src/index.tsx | 2 +- ui/tsconfig.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/src/Game.tsx b/ui/src/Game.tsx index e227d89..04b9f0b 100644 --- a/ui/src/Game.tsx +++ b/ui/src/Game.tsx @@ -7,7 +7,7 @@ import { PlayerAndScore, ScoreResult, Tray, TurnAction, TurnAdvanceResult -} from "word_grid"; +} from "../../pkg/word_grid"; import { HighlightableLetterData, LocationType, @@ -131,7 +131,7 @@ export function Game(props: { }); useEffect(() => { - const newLetterData = props.wasm.get_board_letters() as LetterData[]; + const newLetterData = props.wasm.get_board_letters() as HighlightableLetterData[]; // we need to go through and set 'highlight' field to either true or false // it will always be false if the player that just went was the AI diff --git a/ui/src/Menu.tsx b/ui/src/Menu.tsx index becb895..373a15f 100644 --- a/ui/src/Menu.tsx +++ b/ui/src/Menu.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import {useState} from "react"; -import {Difficulty, GameWasm} from 'word_grid'; +import {Difficulty, GameWasm} from '../../pkg/word_grid'; import {Settings} from "./utils"; import {Game} from "./Game"; diff --git a/ui/src/index.tsx b/ui/src/index.tsx index 68b13f3..809f67c 100644 --- a/ui/src/index.tsx +++ b/ui/src/index.tsx @@ -1,4 +1,4 @@ -import init, {GameWasm} from '../node_modules/word_grid/word_grid.js'; +import init, {GameWasm} from '../../pkg/word_grid.js'; import {Game} from "./Game"; import {createRoot} from "react-dom/client"; import * as React from "react"; diff --git a/ui/tsconfig.json b/ui/tsconfig.json index 77e01d7..7d2caef 100644 --- a/ui/tsconfig.json +++ b/ui/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "target": "ES2023", + "target": "ES2022", "jsx": "react-jsx", "lib": [ "es2023",