Cherry-pick the good stuff from input-per-letter

This commit is contained in:
Lynn
2022-01-14 17:19:42 +01:00
parent 687f2acc22
commit a688c30427
4 changed files with 8 additions and 5 deletions

View File

@@ -73,7 +73,9 @@ function Game(props: GameProps) {
setGuesses((guesses) => guesses.concat([currentGuess]));
setCurrentGuess((guess) => "");
if (currentGuess === target) {
setHint("You won! (Enter to play again)");
setHint(
`You won! The answer was ${target.toUpperCase()}. (Enter to play again)`
);
setGameState(GameState.Won);
} else if (guesses.length + 1 === props.maxGuesses) {
setHint(
@@ -170,7 +172,9 @@ function Game(props: GameProps) {
Give up
</button>
</div>
<table className="Game-rows">{tableRows}</table>
<table className="Game-rows" tabIndex={0}>
<tbody>{tableRows}</tbody>
</table>
<p role="alert">{hint || `\u00a0`}</p>
{/* <p role="alert" className="Game-sr-feedback">
{srStatus}