Daily Industrial Wordl
This commit is contained in:
22
src/Game.tsx
22
src/Game.tsx
@@ -157,7 +157,7 @@ function Game(props: GameProps) {
|
||||
const onKey = (key: string) => {
|
||||
if (gameState !== GameState.Playing) {
|
||||
if (key === "Enter") {
|
||||
startNextGame();
|
||||
// startNextGame();
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -192,9 +192,7 @@ function Game(props: GameProps) {
|
||||
setCurrentGuess((guess) => "");
|
||||
|
||||
const gameOver = (verbed: string) =>
|
||||
`You ${verbed}! The answer was ${target.toUpperCase()}. (Enter to ${
|
||||
challenge ? "play a random game" : "play again"
|
||||
})`;
|
||||
`You ${verbed}! The answer was ${target.toUpperCase()}.`;
|
||||
|
||||
if (currentGuess === target) {
|
||||
setHint(gameOver("won"));
|
||||
@@ -287,7 +285,7 @@ function Game(props: GameProps) {
|
||||
disabled={gameState !== GameState.Playing || guesses.length === 0}
|
||||
onClick={() => {
|
||||
setHint(
|
||||
`The answer was ${target.toUpperCase()}. (Enter to play again)`
|
||||
`The answer was ${target.toUpperCase()}.`
|
||||
);
|
||||
setGameState(GameState.Lost);
|
||||
(document.activeElement as HTMLElement)?.blur();
|
||||
@@ -318,21 +316,7 @@ function Game(props: GameProps) {
|
||||
letterInfo={letterInfo}
|
||||
onKey={onKey}
|
||||
/>
|
||||
<div className="Game-seed-info">
|
||||
{challenge
|
||||
? "playing a challenge game"
|
||||
: seed
|
||||
? `${describeSeed(seed)} — length ${wordLength}, game ${gameNumber}`
|
||||
: "playing a random game"}
|
||||
</div>
|
||||
<p>
|
||||
<button
|
||||
onClick={() => {
|
||||
share("Link copied to clipboard!");
|
||||
}}
|
||||
>
|
||||
Share a link to this game
|
||||
</button>{" "}
|
||||
{gameState !== GameState.Playing && (
|
||||
<button
|
||||
onClick={() => {
|
||||
|
||||
Reference in New Issue
Block a user