From b65950f311e0d692158d42baceb72678662ba796 Mon Sep 17 00:00:00 2001 From: -l Date: Wed, 18 Oct 2023 15:26:52 +0200 Subject: [PATCH] chore: hidden ThemeBadge --- .../src/shared/menu/SidebarMenu.module.scss | 4 ++++ .../src/shared/menu/SidebarMenu.tsx | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/dnb-design-system-portal/src/shared/menu/SidebarMenu.module.scss b/packages/dnb-design-system-portal/src/shared/menu/SidebarMenu.module.scss index 52831522b24..b934c60c8a1 100644 --- a/packages/dnb-design-system-portal/src/shared/menu/SidebarMenu.module.scss +++ b/packages/dnb-design-system-portal/src/shared/menu/SidebarMenu.module.scss @@ -243,6 +243,10 @@ color: white; } + &.dnb-sidebar-menu__theme-badge--hidden { + display: none; + } + &.dnb-sidebar-menu__theme-badge--sbanken { padding: 0; font-family: var(--sb-font-family-headings); diff --git a/packages/dnb-design-system-portal/src/shared/menu/SidebarMenu.tsx b/packages/dnb-design-system-portal/src/shared/menu/SidebarMenu.tsx index 190a044e9c7..66ec3f7cb09 100644 --- a/packages/dnb-design-system-portal/src/shared/menu/SidebarMenu.tsx +++ b/packages/dnb-design-system-portal/src/shared/menu/SidebarMenu.tsx @@ -201,7 +201,14 @@ export default function SidebarLayout({ } } -const ThemeBadge = ({ theme, ...props }: { theme: ThemeNames }) => { +const ThemeBadge = ({ + theme, + currentTheme, + ...props +}: { + theme: ThemeNames + currentTheme: ThemeNames +}) => { const themeTitle = theme && { @@ -217,6 +224,7 @@ const ThemeBadge = ({ theme, ...props }: { theme: ThemeNames }) => { className={classnames( 'dnb-sidebar-menu__theme-badge', `dnb-sidebar-menu__theme-badge--${theme}`, + theme !== currentTheme && 'dnb-sidebar-menu__theme-badge--hidden', )} {...props} > @@ -330,7 +338,7 @@ function ListItem({ {title} - {theme === currentTheme && } + {} {status && ( )}