Fixed icon not colorful on nodes

This commit is contained in:
Lucas Oliveira 2023-11-29 14:01:26 -03:00
commit 9ed9a9dd49
2 changed files with 11 additions and 6 deletions

View file

@ -176,7 +176,7 @@ export default function GenericNode({
<IconComponent <IconComponent
name={data.node?.flow ? "Ungroup" : name} name={data.node?.flow ? "Ungroup" : name}
className={ className={
"generic-node-icon " + "generic-node-icon" +
(!showNode && "absolute inset-x-6 h-12 w-12") (!showNode && "absolute inset-x-6 h-12 w-12")
} }
iconColor={`${nodeColors[types[data.type]]}`} iconColor={`${nodeColors[types[data.type]]}`}

View file

@ -8,14 +8,19 @@ const ForwardedIconComponent = forwardRef(
ref ref
) => { ) => {
const TargetIcon = nodeIconsLucide[name] ?? nodeIconsLucide["unknown"]; const TargetIcon = nodeIconsLucide[name] ?? nodeIconsLucide["unknown"];
const style = {
strokeWidth: 1.5,
className: className,
...(stroke && { stroke: stroke }),
...(iconColor && { color: iconColor, stroke: stroke }),
};
return ( return (
<TargetIcon <TargetIcon
strokeWidth={1.5} style={style}
className={className}
style={iconColor ? { color: iconColor } : {}}
ref={ref} ref={ref}
stroke={stroke ? stroke : "currentColor"} data-testid={id ? `${id}-${name}` : `icon-${name}`}
data-testid={id ? `${id}-${name}` : "icon-" + name}
/> />
); );
} }