Skip to content

Commit e9ceaf5

Browse files
Merge pull request #11699 from vikram-raj/bz-2096392
Bug 2096392: [Dark Theme]: Add white background to node icons in Topology in dark mode
2 parents c4d4c00 + 93089ce commit e9ceaf5

File tree

6 files changed

+35
-7
lines changed

6 files changed

+35
-7
lines changed

Diff for: frontend/packages/knative-plugin/src/topology/components/nodes/EventSink.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ const EventSink: React.FC<EventSinkProps> = ({
117117
{donutStatus && showDetails && !isKafkaSink && (
118118
<PodSet size={size * 0.75} x={width / 2} y={height / 2} data={donutStatus} />
119119
)}
120+
<circle
121+
cx={width * 0.5}
122+
cy={height * 0.5}
123+
r={width * 0.25}
124+
fill="var(--pf-global--palette--white)"
125+
/>
120126
{typeof getEventSourceIcon(data.kind, resources.obj) === 'string' ? (
121127
<image
122128
x={width * 0.33}

Diff for: frontend/packages/knative-plugin/src/topology/components/nodes/EventSource.scss

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
&__svg-icon svg {
2424
width: 100%;
2525
height: 100%;
26+
fill: var(--pf-topology__node__label__icon--Color);
2627
}
2728
}
2829

Diff for: frontend/packages/knative-plugin/src/topology/components/nodes/EventSource.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ const EventSource: React.FC<EventSourceProps> = ({
4848
labelIcon={<EventSourceIcon />}
4949
{...rest}
5050
>
51+
<circle
52+
cx={width * 0.5}
53+
cy={height * 0.5}
54+
r={width * 0.25 + 6}
55+
fill="var(--pf-global--palette--white)"
56+
/>
5157
{typeof getEventSourceIcon(data.kind, resources.obj) === 'string' ? (
5258
<image
5359
x={width * 0.25}

Diff for: frontend/packages/knative-plugin/src/topology/components/nodes/EventingPubSubNode.scss

+6
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,9 @@
4747
}
4848
}
4949
}
50+
51+
:root:where(.pf-theme-dark) .odc-eventing-pubsub {
52+
&--image {
53+
filter: brightness(1.5) invert(1) hue-rotate(180deg) saturate(4);
54+
}
55+
}

Diff for: frontend/packages/knative-plugin/src/topology/components/nodes/EventingPubSubNode.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ const EventingPubSubNode: React.FC<EventingPubSubNodeProps> = ({
7979
width={width * 0.8}
8080
height={width * 0.5}
8181
xlinkHref={eventPubSubImg}
82+
className="odc-eventing-pubsub--image"
8283
/>
8384
{children}
8485
</BaseNode>

Diff for: frontend/packages/topology/src/components/graph-view/components/nodes/BaseNode.tsx

+15-7
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,21 @@ const BaseNode: React.FC<BaseNodeProps> = ({
133133
>
134134
<g data-test-id="base-node-handler">
135135
{icon && showDetails && (
136-
<image
137-
x={cx - iconRadius}
138-
y={cy - iconRadius}
139-
width={iconRadius * 2}
140-
height={iconRadius * 2}
141-
xlinkHref={icon}
142-
/>
136+
<>
137+
<circle
138+
fill="var(--pf-global--palette--white)"
139+
cx={cx}
140+
cy={cy}
141+
r={innerRadius + 6}
142+
/>
143+
<image
144+
x={cx - iconRadius}
145+
y={cy - iconRadius}
146+
width={iconRadius * 2}
147+
height={iconRadius * 2}
148+
xlinkHref={icon}
149+
/>
150+
</>
143151
)}
144152
{showDetails && children}
145153
</g>

0 commit comments

Comments
 (0)