Removed unused parameters in UI
This commit is contained in:
parent
974751bda0
commit
4f8f14364c
3 changed files with 8 additions and 8 deletions
|
@ -143,7 +143,7 @@ export function Game(props: {wasm: GameWasm, settings: Settings}) {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<TileTray letters={playerLetters} trayLength={props.settings.trayLength} dispatch={trayDispatch}/>
|
<TileTray letters={playerLetters} trayLength={props.settings.trayLength} dispatch={trayDispatch}/>
|
||||||
<button onClick={(e) => {
|
<button onClick={() => {
|
||||||
const playedTiles = playerLetters.map((i) => {
|
const playedTiles = playerLetters.map((i) => {
|
||||||
if (i === undefined) {
|
if (i === undefined) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -192,12 +192,12 @@ export function Game(props: {wasm: GameWasm, settings: Settings}) {
|
||||||
|
|
||||||
}}>{confirmedScorePoints > -1 ? `Score ${confirmedScorePoints} points ✅` : "Check"}</button>
|
}}>{confirmedScorePoints > -1 ? `Score ${confirmedScorePoints} points ✅` : "Check"}</button>
|
||||||
<button
|
<button
|
||||||
onClick={(e) => {
|
onClick={() => {
|
||||||
trayDispatch({action: TileDispatchActionType.RETURN}); // want all tiles back on tray for tile exchange
|
trayDispatch({action: TileDispatchActionType.RETURN}); // want all tiles back on tray for tile exchange
|
||||||
setIsTileExchangeOpen(true);
|
setIsTileExchangeOpen(true);
|
||||||
}}
|
}}
|
||||||
>Open Tile Exchange</button>
|
>Open Tile Exchange</button>
|
||||||
<button onClick={(e) => {
|
<button onClick={() => {
|
||||||
trayDispatch({action: TileDispatchActionType.RETURN});
|
trayDispatch({action: TileDispatchActionType.RETURN});
|
||||||
}}>Return Tiles</button>
|
}}>Return Tiles</button>
|
||||||
</>;
|
</>;
|
||||||
|
|
|
@ -38,12 +38,12 @@ export function TileExchangeModal(props: {
|
||||||
Click on each tile you'd like to exchange. You currently have {tilesExchangedSelected} tiles selected.
|
Click on each tile you'd like to exchange. You currently have {tilesExchangedSelected} tiles selected.
|
||||||
</div>
|
</div>
|
||||||
<div className="selection-buttons">
|
<div className="selection-buttons">
|
||||||
<button onClick={(e) => {
|
<button onClick={() => {
|
||||||
const array: boolean[] = [];
|
const array: boolean[] = [];
|
||||||
addNTimes(array, true, props.playerLetters.length);
|
addNTimes(array, true, props.playerLetters.length);
|
||||||
setTilesToExchange(array);
|
setTilesToExchange(array);
|
||||||
}}>Select All</button>
|
}}>Select All</button>
|
||||||
<button onClick={(e) => {
|
<button onClick={() => {
|
||||||
setTilesToExchange(clearExchangeTiles());
|
setTilesToExchange(clearExchangeTiles());
|
||||||
}}>Select None</button>
|
}}>Select None</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -59,7 +59,7 @@ export function TileExchangeModal(props: {
|
||||||
setTilesToExchange(clearExchangeTiles());
|
setTilesToExchange(clearExchangeTiles());
|
||||||
props.setOpen(false);
|
props.setOpen(false);
|
||||||
}}>Cancel</button>
|
}}>Cancel</button>
|
||||||
<button disabled = {tilesExchangedSelected == 0} onClick={(e) => {
|
<button disabled = {tilesExchangedSelected == 0} onClick={() => {
|
||||||
props.exchangeFunction(tilesToExchange);
|
props.exchangeFunction(tilesToExchange);
|
||||||
props.setOpen(false);
|
props.setOpen(false);
|
||||||
}}>Exchange</button>
|
}}>Exchange</button>
|
||||||
|
|
|
@ -158,7 +158,7 @@ export function Grid(props: {
|
||||||
.forEach((letter, i) => {
|
.forEach((letter, i) => {
|
||||||
if (letter.location === LocationType.GRID) {
|
if (letter.location === LocationType.GRID) {
|
||||||
const ct = props.cellTypes[letter.index];
|
const ct = props.cellTypes[letter.index];
|
||||||
const {className, text} = cellTypeToDetails(ct);
|
const {className} = cellTypeToDetails(ct);
|
||||||
|
|
||||||
elements[letter.index] =
|
elements[letter.index] =
|
||||||
<div key={"letter" + letter.index} className={"grid-spot " + className}>
|
<div key={"letter" + letter.index} className={"grid-spot " + className}>
|
||||||
|
@ -183,7 +183,7 @@ export function Grid(props: {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Scores(props: {playerScores: Array<PlayerAndScore>}){
|
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}>
|
return <div key={ps.name}>
|
||||||
<h3>{ps.name}</h3>
|
<h3>{ps.name}</h3>
|
||||||
<span>{ps.score}</span>
|
<span>{ps.score}</span>
|
||||||
|
|
Loading…
Reference in a new issue