Skip to content

Commit 56fc4e4

Browse files
committed
frontend: Fix warning label color contrast
1 parent 937b35b commit 56fc4e4

File tree

6 files changed

+12
-9
lines changed

6 files changed

+12
-9
lines changed

frontend/src/components/common/Label.stories/__snapshots__/StatusLabel.Warning.stories.storyshot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<body>
22
<div>
33
<span
4-
class="MuiTypography-root MuiTypography-body1 css-1cqtycm-MuiTypography-root"
4+
class="MuiTypography-root MuiTypography-body1 css-1dablfr-MuiTypography-root"
55
>
66
warning
77
</span>

frontend/src/components/common/Label.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,12 @@ export const StatusLabel = forwardRef<HTMLSpanElement, StatusLabelProps>((props,
104104
borderColor: theme.palette.divider,
105105
};
106106
} else if (isLight) {
107+
const bg = baseColor;
108+
const fg = status === 'warning' ? '#000000ff' : theme.palette.getContrastText(bg);
109+
107110
params = {
108-
backgroundColor: baseColor,
109-
color: theme.palette.getContrastText(baseColor),
111+
backgroundColor: bg,
112+
color: fg,
110113
borderColor: 'transparent',
111114
};
112115
} else {

frontend/src/components/pod/__snapshots__/PodDetails.Initializing.stories.storyshot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@
796796
class="MuiBox-root css-0"
797797
>
798798
<span
799-
class="MuiTypography-root MuiTypography-body1 css-1cqtycm-MuiTypography-root"
799+
class="MuiTypography-root MuiTypography-body1 css-1dablfr-MuiTypography-root"
800800
>
801801
Waiting (PodInitializing)
802802
</span>
@@ -1046,7 +1046,7 @@
10461046
class="MuiBox-root css-0"
10471047
>
10481048
<span
1049-
class="MuiTypography-root MuiTypography-body1 css-1cqtycm-MuiTypography-root"
1049+
class="MuiTypography-root MuiTypography-body1 css-1dablfr-MuiTypography-root"
10501050
>
10511051
Waiting (PodInitializing)
10521052
</span>

frontend/src/components/pod/__snapshots__/PodDetails.LivenessFailed.stories.storyshot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@
239239
data-mui-internal-clone-element="true"
240240
>
241241
<span
242-
class="MuiTypography-root MuiTypography-body1 css-1cqtycm-MuiTypography-root"
242+
class="MuiTypography-root MuiTypography-body1 css-1dablfr-MuiTypography-root"
243243
>
244244
CrashLoopBackOff
245245
</span>
@@ -791,7 +791,7 @@
791791
>
792792
<span
793793
aria-describedby="container-state-message-liveness"
794-
class="MuiTypography-root MuiTypography-body1 css-1cqtycm-MuiTypography-root"
794+
class="MuiTypography-root MuiTypography-body1 css-1dablfr-MuiTypography-root"
795795
>
796796
Waiting (CrashLoopBackOff)
797797
</span>

frontend/src/components/pod/__snapshots__/PodDetails.PullBackOff.stories.storyshot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@
791791
>
792792
<span
793793
aria-describedby="container-state-message-imagepullbackoff"
794-
class="MuiTypography-root MuiTypography-body1 css-1cqtycm-MuiTypography-root"
794+
class="MuiTypography-root MuiTypography-body1 css-1dablfr-MuiTypography-root"
795795
>
796796
Waiting (ImagePullBackOff)
797797
</span>

frontend/src/components/pod/__snapshots__/PodList.Items.stories.storyshot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@
14231423
data-mui-internal-clone-element="true"
14241424
>
14251425
<span
1426-
class="MuiTypography-root MuiTypography-body1 css-1cqtycm-MuiTypography-root"
1426+
class="MuiTypography-root MuiTypography-body1 css-1dablfr-MuiTypography-root"
14271427
>
14281428
CrashLoopBackOff
14291429
</span>

0 commit comments

Comments
 (0)