Merge pull request #20142 from backstage/rugvip/theme-icons

user-settings: fix theme icon colors
This commit is contained in:
Patrik Oldsberg
2023-09-25 16:05:29 +02:00
committed by GitHub
2 changed files with 11 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-user-settings': patch
---
Fixed a bug where the theme icons would not be colored according to their active state.
@@ -141,8 +141,8 @@ export const UserSettingsThemeToggle = () => {
onChange={handleSetTheme}
>
{themeIds.map(theme => {
const themeIcon = themeIds.find(it => it.id === theme.id)?.icon;
const themeId = theme.id;
const themeIcon = theme.icon;
const themeTitle =
theme.title ||
(themeId === 'light' || themeId === 'dark'
@@ -156,7 +156,11 @@ export const UserSettingsThemeToggle = () => {
>
<>
{themeTitle}&nbsp;
<ThemeIcon id={themeId} icon={themeIcon} activeId={themeId} />
<ThemeIcon
id={themeId}
icon={themeIcon}
activeId={activeThemeId}
/>
</>
</TooltipToggleButton>
);