up
This commit is contained in:
@@ -132,6 +132,12 @@ const NoteFlow = () => {
|
|||||||
const handleTabClick = (option) => {
|
const handleTabClick = (option) => {
|
||||||
setShowTabBar(false);
|
setShowTabBar(false);
|
||||||
|
|
||||||
|
|
||||||
|
if (selectedNodeId === option.id) {
|
||||||
|
alert('Node này đã được thêm. Vui lòng chọn một node khác.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const newNode = {
|
const newNode = {
|
||||||
id: option.id,
|
id: option.id,
|
||||||
data: { label: option.html },
|
data: { label: option.html },
|
||||||
@@ -250,6 +256,7 @@ const NoteFlow = () => {
|
|||||||
setShowPopup(false);
|
setShowPopup(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ height: '100vh', width: '100%', position: 'relative' }}>
|
<div style={{ height: '100vh', width: '100%', position: 'relative' }}>
|
||||||
<ReactFlow nodes={nodes} edges={edges} onNodeClick={onNodeClick} onNodeContextMenu={onNodeContextMenu} onNodeDoubleClick={onNodeDoubleClick}>
|
<ReactFlow nodes={nodes} edges={edges} onNodeClick={onNodeClick} onNodeContextMenu={onNodeContextMenu} onNodeDoubleClick={onNodeDoubleClick}>
|
||||||
@@ -272,6 +279,7 @@ const NoteFlow = () => {
|
|||||||
<div
|
<div
|
||||||
key={option.id}
|
key={option.id}
|
||||||
onClick={() => handleTabClick(option)}
|
onClick={() => handleTabClick(option)}
|
||||||
|
|
||||||
style={{
|
style={{
|
||||||
padding: '10px',
|
padding: '10px',
|
||||||
cursor: selectedNodeId === option.id ? 'not-allowed' : 'pointer',
|
cursor: selectedNodeId === option.id ? 'not-allowed' : 'pointer',
|
||||||
|
|||||||
Reference in New Issue
Block a user