From d85fc135dee89dc88184b9f909f795cf410fc075 Mon Sep 17 00:00:00 2001 From: Jenny <32821331+jenny-s51@users.noreply.github.com> Date: Fri, 8 Mar 2024 09:25:00 -0500 Subject: [PATCH] revert action label styling to default, adds isIconExternal prop --- .../src/components/nodes/labels/LabelActionIcon.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/module/src/components/nodes/labels/LabelActionIcon.tsx b/packages/module/src/components/nodes/labels/LabelActionIcon.tsx index 08b3329..a799d19 100644 --- a/packages/module/src/components/nodes/labels/LabelActionIcon.tsx +++ b/packages/module/src/components/nodes/labels/LabelActionIcon.tsx @@ -20,12 +20,11 @@ interface LabelActionIconProps { } const LabelActionIcon = React.forwardRef( - ({ icon, isIconExternal, onClick, className, x, y, paddingX, height}) => { + ({ icon, isIconExternal, onClick, className, x, y, paddingX, height, iconOffsetX = 0, iconOffsetY = 0 }) => { const [iconSize, iconRef] = useSize([icon, paddingX]); const iconWidth = iconSize?.width ?? 0; - const iconHeight = iconSize?.height ?? 0; - // const [hovered, hoverRef] = useHover(); - + const iconHeight = iconSize?.height ?? 0; + const iconY = (height - iconHeight) / 2; const centerX = x + height / 2 - iconWidth / 2; const centerY = y + height / 2 - iconHeight / 2; @@ -46,13 +45,13 @@ const LabelActionIcon = React.forwardRef( className={isIconExternal ? css(pipelineStyles.topologyPipelinesNodeActionIconBackground) : css(styles.topologyNodeActionIconBackground)} x={x} y={y} - width={height} + width={isIconExternal ? height :iconWidth + paddingX * 2} height={height} /> )} {icon}