fixed issue with keyToStr function

This commit is contained in:
Clément Le Bihan
2023-03-20 00:19:36 +01:00
parent efede253dc
commit aa72f34a6c
3 changed files with 8 additions and 11 deletions
@@ -86,7 +86,7 @@ const PianoKeyComp = ({
alignItems="center"
>
{isNoteVisible(showNoteNames, isPressed, isHovered) && (
<Text {...textProps}>{keyToStr(pianoKey)}</Text>
<Text {...textProps}>{keyToStr(pianoKey, false)}</Text>
)}
</Box>
)}
@@ -1,7 +1,7 @@
import { Row, Box } from "native-base";
import React, { useState, useEffect } from "react";
import Octave from "./Octave";
import { Note, PianoKey, NoteNameBehavior, KeyPressStyle, octaveKeys } from "../../models/Piano";
import { Note, PianoKey, NoteNameBehavior, KeyPressStyle, keyToStr } from "../../models/Piano";
type VirtualPianoProps = Parameters<typeof Row>[0] & {
onNoteDown: (note: PianoKey) => void;
@@ -75,10 +75,10 @@ const VirtualPiano = ({
VirtualPiano.defaultProps = {
onNoteDown: (n) => {
console.log("Note down: " + n);
console.log("Note down: " + keyToStr(n));
},
onNoteUp: (n) => {
console.log("Note up: " + n);
console.log("Note up: " + keyToStr(n));
},
startOctave: 2,
startNote: Note.C,