style: reformated DragDropSidebar.tsx to be compliant with code standards

ref: N25B-114
This commit is contained in:
JGerla
2025-10-09 16:55:08 +02:00
parent ff8a617c5e
commit ece94b0b02

View File

@@ -11,7 +11,6 @@ import {
} from 'react'; } from 'react';
// improve later to create better automatic IDs
let id = 0; let id = 0;
const getId = () => `dndnode_${id++}`; const getId = () => `dndnode_${id++}`;
@@ -48,7 +47,8 @@ function DraggableNode({ className, children, nodeType, onDrop }: DraggableNodeP
}); });
return ( return (
<div className={className === "default" ? "draggable-node" : "draggable-node" + "__" + className} ref={draggableRef}> <div className={className === "default" ? "draggable-node" : "draggable-node" + "__" + className}
ref={draggableRef}>
{children} {children}
</div> </div>
); );
@@ -120,11 +120,26 @@ export function Sidebar() {
); );
return ( return (
<aside style={{padding: '10px 10px',outline: '2.5pt solid black',borderRadius: '0pt 0pt 5pt 5pt', borderColor:'dimgrey', backgroundColor:'canvas', display:'flex', flexDirection: 'column', gap: '1rem'}}> <aside style={{
padding: '10px 10px',
outline: '2.5pt solid black',
borderRadius: '0pt 0pt 5pt 5pt',
borderColor: 'dimgrey',
backgroundColor: 'canvas',
display: 'flex',
flexDirection: 'column',
gap: '1rem'
}}>
<div className="description"> <div className="description">
You can drag these nodes to the pane to create new nodes. You can drag these nodes to the pane to create new nodes.
</div> </div>
<div className="DraggableNodeContainer" style={{backgroundColor:'canvas', display: 'flex', flexDirection: 'row', gap: '1rem', justifyContent: 'center'}}> <div className="DraggableNodeContainer" style={{
backgroundColor: 'canvas',
display: 'flex',
flexDirection: 'row',
gap: '1rem',
justifyContent: 'center'
}}>
<DraggableNode className="phase" nodeType="phase" onDrop={handleNodeDrop}> <DraggableNode className="phase" nodeType="phase" onDrop={handleNodeDrop}>
phase Node phase Node
</DraggableNode> </DraggableNode>