Fix bug for sidebar dropdown button and add changeset

Signed-off-by: Bjørn-Erik Strand <bjoern.erik.strand@gmail.com>
This commit is contained in:
Bjørn-Erik Strand
2025-02-11 13:50:22 +01:00
parent cddc2e6cbd
commit df3b9f0d21
3 changed files with 28 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-components': patch
---
Fixed a bug in the SidebarSubmenuItem within the core-components package that caused the dropdown button to be misaligned in the sidebar and the button text to appear in uppercase due to the default <Button> behavior. Also added an example dropdown menu to the app for reference.
+19
View File
@@ -132,6 +132,25 @@ export const Root = ({ children }: PropsWithChildren<{}>) => (
to="catalog?filters[kind]=user"
icon={useApp().getSystemIcon('kind:user')}
/>
<SidebarDivider />
<SidebarSubmenuItem
title="Templates"
icon={useApp().getSystemIcon('kind:template')}
dropdownItems={[
{
title: 'Documentation',
to: 'catalog?filters[kind]=template&filters[type]=documentation',
},
{
title: 'Service',
to: 'catalog?filters[kind]=template&filters[type]=service',
},
{
title: 'Website',
to: 'catalog?filters[kind]=template&filters[type]=website',
},
]}
/>
</SidebarSubmenu>
</SidebarItem>
<MyGroupsSidebarItem
@@ -185,6 +185,10 @@ export const SidebarSubmenuItem = (props: SidebarSubmenuItemProps) => {
classes.item,
isActive ? classes.selected : undefined,
)}
style={{
textTransform: 'none',
justifyContent: 'flex-start',
}}
>
{Icon && <Icon fontSize="small" />}
<Typography