Skip to content

Commit

Permalink
chore: hidden ThemeBadge
Browse files Browse the repository at this point in the history
  • Loading branch information
langz committed Oct 18, 2023
1 parent f0a01e8 commit 0dae141
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 10 additions & 2 deletions packages/dnb-design-system-portal/src/shared/menu/SidebarMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
{
Expand All @@ -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}
>
Expand Down Expand Up @@ -330,7 +338,7 @@ function ListItem({
{title}
</span>
</span>
{theme === currentTheme && <ThemeBadge theme={theme} />}
{<ThemeBadge theme={theme} currentTheme={currentTheme} />}
{status && (
<Badge space={{ right: 'xx-small' }} content={statusTitle} />
)}
Expand Down

0 comments on commit 0dae141

Please sign in to comment.