From cd73273261422c115b9792173b3b62d49b6ac2d6 Mon Sep 17 00:00:00 2001 From: Benoit Pimpaud Date: Thu, 28 Sep 2023 21:13:47 +0200 Subject: [PATCH] [refactor] remove useless log, alert and add key mapping --- src/CustomNode.tsx | 1 - src/Search.tsx | 3 +-- src/SearchList.tsx | 21 +++++++++++++++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/CustomNode.tsx b/src/CustomNode.tsx index 2851d36..2d44007 100644 --- a/src/CustomNode.tsx +++ b/src/CustomNode.tsx @@ -14,7 +14,6 @@ type Props = { } const CustomNode = ({ data, isConnectable }: Props) => { - console.log(data) const { image, title, artist, key, bpm } = data return ( diff --git a/src/Search.tsx b/src/Search.tsx index 69af4f5..49de98c 100644 --- a/src/Search.tsx +++ b/src/Search.tsx @@ -51,7 +51,6 @@ function Search() { }); const trackFeatures = await Promise.all(trackFeaturesPromises); - console.log(trackFeatures) setTracks(trackFeatures) } @@ -65,7 +64,7 @@ function Search() { const json = JSON.stringify(data); const blob = new Blob([json], { type: 'application/json' }); - saveAs(blob, 'graph_data.json'); + saveAs(blob, 'track_lineage_export.json'); } const fileInputRef = React.createRef(); diff --git a/src/SearchList.tsx b/src/SearchList.tsx index 980b129..309ca88 100644 --- a/src/SearchList.tsx +++ b/src/SearchList.tsx @@ -13,7 +13,25 @@ function getKey(key) { case 1: return 'C#/Db'; case 2: - return 'D' + return 'D'; + case 3: + return 'D#/Eb'; + case 4: + return 'E'; + case 5: + return 'F'; + case 6: + return 'F#/Gb'; + case 7: + return 'G'; + case 8: + return 'G#/Ab'; + case 9: + return 'A'; + case 10: + return 'A#/Bb'; + case 11: + return 'B' default: return 'KEY'; } @@ -21,7 +39,6 @@ function getKey(key) { function SearchList({ nodes, setNodes, tracks }: Props) { function onSubmit(track, event: FormEvent) { event.preventDefault() - console.log(track) setNodes( nodes.concat({ id: track.track.id,