-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from Ben8t/dev/refacto
minor refactoring
- Loading branch information
Showing
9 changed files
with
878 additions
and
2,221 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,36 @@ | ||
import { useCallback } from 'react'; | ||
import { Handle, Position } from 'reactflow'; | ||
|
||
import { useCallback } from 'react' | ||
import { Handle, Position } from 'reactflow' | ||
|
||
function CustomNode({ data, isConnectable }) { | ||
const onChange = useCallback((evt) => { | ||
console.log(evt.target.value); | ||
}, []); | ||
console.log(evt.target.value) | ||
}, []) | ||
|
||
return ( | ||
<div className="text-updater-node shadow-md"> | ||
<Handle type="target" position={Position.Left} id="target" isConnectable={isConnectable} className="h-3 w-3 bg-purple"/> | ||
<Handle | ||
type="target" | ||
position={Position.Left} | ||
id="target" | ||
isConnectable={isConnectable} | ||
className="h-3 w-3 bg-purple" | ||
/> | ||
<div> | ||
<label>{data.label}</label> | ||
<hr /> | ||
<span>Key: {data.key}</span> | ||
<span>BPM: {data.bpm}</span> | ||
<span>Style: {data.style}</span> | ||
</div> | ||
<Handle type="source" position={Position.Right} id="source" isConnectable={isConnectable} className="h-3 w-3 bg-purple" /> | ||
<Handle | ||
type="source" | ||
position={Position.Right} | ||
id="source" | ||
isConnectable={isConnectable} | ||
className="h-3 w-3 bg-purple" | ||
/> | ||
</div> | ||
); | ||
) | ||
} | ||
|
||
export default CustomNode; | ||
export default CustomNode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
import SearchList from './SearchList.tsx' | ||
|
||
function Search({ nodes, setNodes }: Props) { | ||
return ( | ||
<div className="search bg-gray-100 rounded-lg"> | ||
<span className='font-mono text-1xl font-bold'>Search</span> | ||
<SearchList nodes={nodes} setNodes={setNodes} /> | ||
</div> | ||
) | ||
} | ||
|
||
export default Search | ||
|
||
return ( | ||
<div className="search rounded-lg bg-gray-100"> | ||
<span className="text-1xl font-mono font-bold">Search</span> | ||
<SearchList nodes={nodes} setNodes={setNodes} /> | ||
</div> | ||
) | ||
} | ||
|
||
export default Search |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
.text-updater-node { | ||
width: 10rem; | ||
border: 1px solid rgba(137, 38, 215, 0.3); | ||
padding: 5px; | ||
border-radius: 5px; | ||
background: white; | ||
} | ||
|
||
.text-updater-node span { | ||
display: block; | ||
color: #777; | ||
font-size: 12px; | ||
} | ||
|
||
width: 10rem; | ||
border: 1px solid rgba(137, 38, 215, 0.3); | ||
padding: 5px; | ||
border-radius: 5px; | ||
background: white; | ||
} | ||
|
||
.text-updater-node span { | ||
display: block; | ||
color: #777; | ||
font-size: 12px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
|
||
|
||
function create_library(nb_title: number){ | ||
var tmp = []; | ||
for (let i = 0; i < nb_title; i++) { | ||
const node = { | ||
id: `${i}`, | ||
sourcePosition: 'right', | ||
targetPosition: 'left', | ||
data: { label: `Title ${i}`, bpm: '110', key: 'Eb', style:'Disco' }, | ||
position: { x: 500, y: 100 }, | ||
}; | ||
tmp.push(node); | ||
function create_library(nb_title: number) { | ||
var tmp = [] | ||
for (let i = 0; i < nb_title; i++) { | ||
const node = { | ||
id: `${i}`, | ||
sourcePosition: 'right', | ||
targetPosition: 'left', | ||
data: { label: `Title ${i}`, bpm: '110', key: 'Eb', style: 'Disco' }, | ||
position: { x: 500, y: 100 }, | ||
} | ||
return tmp; | ||
tmp.push(node) | ||
} | ||
return tmp | ||
} | ||
|
||
const node_library = create_library(10); | ||
const node_library = create_library(10) | ||
|
||
export default node_library; | ||
export default node_library |