Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,57 @@
}

/* end validation errors */

.dec-start-end-node {
position: relative;
display: flex;
justify-content: center;
align-items: center;
Comment thread
kumaradityaraj marked this conversation as resolved.
}

.dec-start-node,
.dec-end-node {
width: 72px;
height: 72px;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
position: relative;
background: var(--color-background, white);
}

.dec-start-node {
border: 1px solid #aea6a6;
background-color: #f2f2f2;
}

.dec-end-node {
border: 1px solid #aea6a6;
background-color: #e7e3e3;
}

.dec-end-node-inner {
position: absolute;
inset: 6px;
border-radius: 50%;
border: 1px solid #aea6a6;
background-color: #e7e3e3;
pointer-events: none;
}

.dec-start-end-node.selected .dec-start-node {
box-shadow: 0 0 0 4px rgba(209, 204, 204, 0.3);
}

.dec-start-end-node.selected .dec-end-node {
box-shadow: 0 0 0 4px rgba(209, 204, 204, 0.3);
}

.dec-start-node:hover,
.dec-end-node:hover {
box-shadow: 0 0 0 4px rgba(209, 204, 204, 0.3);
}
}

/* custom edges */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,26 +182,18 @@ function TerminalNodeContent({ id, type }: { id: string; type: TerminalNodeType
);
}

// TODO: These props are just a placeholder
interface PlaceholderProps {
id: string;
data: BaseNodeData;
selected: boolean;
type: string;
}

// TODO: This content is just a placeholder
function PlaceholderContent({ id, data, selected, type }: PlaceholderProps) {
function StartEndNode({ id, data, selected, type }: NodeContentProps) {
const isStart = type === GraphNodeType.Start;
return (
<div
className={`custom-node-container ${selected ? "selected" : ""}`}
className={`dec-start-end-node ${selected ? "selected" : ""}`}
data-testid={`${type}-node-${id}`}
>
<RF.Handle type="target" position={RF.Position.Top} />
<div className="node-label-container" data-testid={`${type}-label-${id}`}>
{`${type}\n${data.label}`}
{!isStart && <RF.Handle type="target" position={RF.Position.Top} />}
<div className={isStart ? "dec-start-node" : "dec-end-node"}>
{!isStart && <div className="dec-end-node-inner" />}
</div>
<RF.Handle type="source" position={RF.Position.Bottom} />
{isStart && <RF.Handle type="source" position={RF.Position.Bottom} />}
</div>
Comment thread
kumaradityaraj marked this conversation as resolved.
);
}
Expand All @@ -210,14 +202,14 @@ function PlaceholderContent({ id, data, selected, type }: PlaceholderProps) {
export type StartNodeType = RF.Node<BaseNodeData, typeof GraphNodeType.Start>;
export function StartNode({ id, data, selected, type }: RF.NodeProps<StartNodeType>) {
// TODO: This component is just a placeholder
return <PlaceholderContent id={id} data={data} selected={selected} type={type} />;
return <StartEndNode id={id} data={data} selected={selected} type={type} />;
}

/* end node */
export type EndNodeType = RF.Node<BaseNodeData, typeof GraphNodeType.End>;
export function EndNode({ id, data, selected, type }: RF.NodeProps<EndNodeType>) {
// TODO: This component is just a placeholder
return <PlaceholderContent id={id} data={data} selected={selected} type={type} />;
return <StartEndNode id={id} data={data} selected={selected} type={type} />;
}

/* entry node */
Expand Down
5 changes: 4 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading