Removed unused parameters in UI

This commit is contained in:
Joel Therrien 2023-08-23 21:58:34 -07:00
parent 974751bda0
commit 4f8f14364c
3 changed files with 8 additions and 8 deletions

View file

@ -143,7 +143,7 @@ export function Game(props: {wasm: GameWasm, settings: Settings}) {
</div>
<TileTray letters={playerLetters} trayLength={props.settings.trayLength} dispatch={trayDispatch}/>
<button onClick={(e) => {
<button onClick={() => {
const playedTiles = playerLetters.map((i) => {
if (i === undefined) {
return null;
@ -192,12 +192,12 @@ export function Game(props: {wasm: GameWasm, settings: Settings}) {
}}>{confirmedScorePoints > -1 ? `Score ${confirmedScorePoints} points ✅` : "Check"}</button>
<button
onClick={(e) => {
onClick={() => {
trayDispatch({action: TileDispatchActionType.RETURN}); // want all tiles back on tray for tile exchange
setIsTileExchangeOpen(true);
}}
>Open Tile Exchange</button>
<button onClick={(e) => {
<button onClick={() => {
trayDispatch({action: TileDispatchActionType.RETURN});
}}>Return Tiles</button>
</>;

View file

@ -38,12 +38,12 @@ export function TileExchangeModal(props: {
Click on each tile you'd like to exchange. You currently have {tilesExchangedSelected} tiles selected.
</div>
<div className="selection-buttons">
<button onClick={(e) => {
<button onClick={() => {
const array: boolean[] = [];
addNTimes(array, true, props.playerLetters.length);
setTilesToExchange(array);
}}>Select All</button>
<button onClick={(e) => {
<button onClick={() => {
setTilesToExchange(clearExchangeTiles());
}}>Select None</button>
</div>
@ -59,7 +59,7 @@ export function TileExchangeModal(props: {
setTilesToExchange(clearExchangeTiles());
props.setOpen(false);
}}>Cancel</button>
<button disabled = {tilesExchangedSelected == 0} onClick={(e) => {
<button disabled = {tilesExchangedSelected == 0} onClick={() => {
props.exchangeFunction(tilesToExchange);
props.setOpen(false);
}}>Exchange</button>

View file

@ -158,7 +158,7 @@ export function Grid(props: {
.forEach((letter, i) => {
if (letter.location === LocationType.GRID) {
const ct = props.cellTypes[letter.index];
const {className, text} = cellTypeToDetails(ct);
const {className} = cellTypeToDetails(ct);
elements[letter.index] =
<div key={"letter" + letter.index} className={"grid-spot " + className}>
@ -183,7 +183,7 @@ export function Grid(props: {
}
export function Scores(props: {playerScores: Array<PlayerAndScore>}){
let elements = props.playerScores.map((ps, i) => {
let elements = props.playerScores.map((ps) => {
return <div key={ps.name}>
<h3>{ps.name}</h3>
<span>{ps.score}</span>