Skip to content

Commit

Permalink
chore: reduce font size for note name and simplify jsx conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
gregjopa committed Apr 1, 2023
1 parent f7be23b commit aa17989
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
19 changes: 7 additions & 12 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ function App() {
playNote(noteValue, octave);
}

const waitingForGuess =
gameState === GameState.WaitingForGuess ||
gameState === GameState.NotStarted;

return (
<>
<div className="mx-auto h-[900px] max-w-2xl bg-slate-50 px-8 pb-8 text-lg text-slate-600 md:border-x md:border-b md:border-solid md:border-gray-500">
Expand All @@ -186,22 +190,13 @@ function App() {
<NoteSelector
selectedNote={guessedNoteName}
onNoteNameChange={handleGuess}
isDisabled={
gameState !== GameState.WaitingForGuess &&
gameState !== GameState.NotStarted
}
shouldFocus={
gameState === GameState.WaitingForGuess ||
gameState === GameState.NotStarted
}
isDisabled={!waitingForGuess}
shouldFocus={waitingForGuess}
/>
<StaveNote
note={actualNote}
onClick={handleStaveNoteClick}
shouldDisplayNoteName={
gameState !== GameState.WaitingForGuess &&
gameState !== GameState.NotStarted
}
shouldDisplayNoteName={!waitingForGuess}
/>
<div>Score: {countOfCorrectGuesses}</div>

Expand Down
2 changes: 1 addition & 1 deletion src/components/StaveNote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function draw({
.setLine(11)
.setFont(
'-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
12,
10,
400
);

Expand Down

0 comments on commit aa17989

Please sign in to comment.