user-settings: fix theme icon colors

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-09-25 11:25:46 +02:00
parent 27f62283df
commit d1b637d005
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>
);