Skip to content

Commit

Permalink
fix(topology): use badgeTextColor when set
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-phillips-18 committed Apr 5, 2023
1 parent 2418be1 commit f10c659
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 7 additions & 0 deletions packages/demo-app-ts/src/Demo.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,10 @@
--pf-c-page__main-section--PaddingLeft: 0;
--pf-c-page__main-section--PaddingBottom: 0;
}

.topology-demo-badge > rect {
fill: var(--pf-global--palette--red-100);
}
.topology-demo-badge > text {
fill: var(--pf-global--palette--gold-100);
}
6 changes: 2 additions & 4 deletions packages/demo-app-ts/src/utils/styleUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export const createBadgeNodes = (options: {
x: columnWidth * 2,
y: (options.row - 1) * BOTTOM_LABEL_ROW_HEIGHT,
badgeColor: '#ace12e',
badgeTextColor: '#0f280d',
badgeTextColor: '#ff0000',
badgeBorderColor: '#486b00',
labelIconClass: options.showIconClass ? logos.get('icon-nodejs') : undefined,
truncateLength: 13,
Expand Down Expand Up @@ -324,9 +324,7 @@ export const createBadgeNodes = (options: {
shape: NodeShape.octagon,
x: columnWidth * 5,
y: (options.row - 1) * BOTTOM_LABEL_ROW_HEIGHT,
badgeColor: '#ace12e',
badgeTextColor: '#0f280d',
badgeBorderColor: '#486b00',
badgeClassName: 'topology-demo-badge',
labelIconClass: options.showIconClass ? logos.get('icon-jenkins') : undefined,
truncateLength: 13,
...options
Expand Down
2 changes: 1 addition & 1 deletion packages/module/src/components/nodes/labels/LabelBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const LabelBadge = React.forwardRef<SVGRectElement, LabelBadgeProps>(
<g className={classes} transform={`translate(${x}, ${y})`}>
{rect}
<text
fill={badgeTextColor || badgeClassName ? undefined : defaultBadgeTextColor.value}
fill={badgeTextColor || badgeClassName ? badgeTextColor : defaultBadgeTextColor.value}
ref={textRef}
x={width / 2 + paddingX}
y={height / 2}
Expand Down

0 comments on commit f10c659

Please sign in to comment.