fix: keep main actor column highlighted on abandon
This commit is contained in:
parent
2c5c9899bd
commit
253fdcf040
1 changed files with 6 additions and 7 deletions
|
|
@ -50,24 +50,23 @@ export default function GameRow({ actorName, pos, colStart, totalWidth, hintType
|
|||
);
|
||||
}
|
||||
|
||||
const isMainActorCell = charIndex === pos;
|
||||
const attemptedLetter = typeof attemptedLetters?.[charIndex] === 'string'
|
||||
? attemptedLetters[charIndex].toUpperCase()
|
||||
: '';
|
||||
const correctLetter = ch.toUpperCase();
|
||||
const revealState = !revealed
|
||||
const revealState = !revealed || isMainActorCell
|
||||
? null
|
||||
: attemptedLetter === ''
|
||||
? null
|
||||
: attemptedLetter === correctLetter
|
||||
? 'correct'
|
||||
: 'wrong';
|
||||
: attemptedLetter === correctLetter
|
||||
? 'correct'
|
||||
: 'wrong';
|
||||
|
||||
return (
|
||||
<LetterInput
|
||||
key={colIndex}
|
||||
rowIndex={rowIndex}
|
||||
charIndex={charIndex}
|
||||
highlighted={!revealed && charIndex === pos}
|
||||
highlighted={isMainActorCell}
|
||||
inputRef={setInputRef(charIndex)}
|
||||
onNext={() => focusNextInput(charIndex, 1)}
|
||||
onPrev={() => focusNextInput(charIndex, -1)}
|
||||
|
|
|
|||
Loading…
Reference in a new issue