Fixed icon not colorful on nodes
This commit is contained in:
parent
7638ee9547
commit
9ed9a9dd49
2 changed files with 11 additions and 6 deletions
|
|
@ -176,7 +176,7 @@ export default function GenericNode({
|
|||
<IconComponent
|
||||
name={data.node?.flow ? "Ungroup" : name}
|
||||
className={
|
||||
"generic-node-icon " +
|
||||
"generic-node-icon" +
|
||||
(!showNode && "absolute inset-x-6 h-12 w-12")
|
||||
}
|
||||
iconColor={`${nodeColors[types[data.type]]}`}
|
||||
|
|
|
|||
|
|
@ -8,14 +8,19 @@ const ForwardedIconComponent = forwardRef(
|
|||
ref
|
||||
) => {
|
||||
const TargetIcon = nodeIconsLucide[name] ?? nodeIconsLucide["unknown"];
|
||||
|
||||
const style = {
|
||||
strokeWidth: 1.5,
|
||||
className: className,
|
||||
...(stroke && { stroke: stroke }),
|
||||
...(iconColor && { color: iconColor, stroke: stroke }),
|
||||
};
|
||||
|
||||
return (
|
||||
<TargetIcon
|
||||
strokeWidth={1.5}
|
||||
className={className}
|
||||
style={iconColor ? { color: iconColor } : {}}
|
||||
style={style}
|
||||
ref={ref}
|
||||
stroke={stroke ? stroke : "currentColor"}
|
||||
data-testid={id ? `${id}-${name}` : "icon-" + name}
|
||||
data-testid={id ? `${id}-${name}` : `icon-${name}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue