Skip to content

Commit

Permalink
[refactor] remove useless log, alert and add key mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben8t committed Sep 28, 2023
1 parent cdc1179 commit cd73273
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/CustomNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ type Props = {
}

const CustomNode = ({ data, isConnectable }: Props) => {
console.log(data)
const { image, title, artist, key, bpm } = data

return (
Expand Down
3 changes: 1 addition & 2 deletions src/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ function Search() {
});

const trackFeatures = await Promise.all(trackFeaturesPromises);
console.log(trackFeatures)

setTracks(trackFeatures)
}
Expand All @@ -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();
Expand Down
21 changes: 19 additions & 2 deletions src/SearchList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,32 @@ 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';
}
}
function SearchList({ nodes, setNodes, tracks }: Props) {
function onSubmit(track, event: FormEvent<HTMLFormElement>) {
event.preventDefault()
console.log(track)
setNodes(
nodes.concat({
id: track.track.id,
Expand Down

0 comments on commit cd73273

Please sign in to comment.