Merge pull request #15215 from blakestoddard/fix-sidebar-icon-alignment

Fix sidebar icon alignment
This commit is contained in:
Fredrik Adelöw
2022-12-14 16:40:41 +01:00
committed by GitHub
2 changed files with 10 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-components': patch
---
Update sidebar icon alignment
@@ -140,6 +140,7 @@ const makeSidebarStyles = (sidebarConfig: SidebarConfig) =>
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
lineHeight: '0',
},
searchRoot: {
marginBottom: 12,
@@ -371,12 +372,14 @@ const SidebarItemBase = forwardRef<any, SidebarItemProps>((props, ref) => {
const { isOpen } = useSidebarOpenState();
const divStyle =
!isOpen && hasSubmenu ? { display: 'flex', marginLeft: '24px' } : {};
!isOpen && hasSubmenu
? { display: 'flex', marginLeft: '20px' }
: { lineHeight: '0' };
const displayItemIcon = (
<Box style={divStyle}>
<Icon fontSize="small" />
{!isOpen && hasSubmenu ? <ArrowRightIcon /> : <></>}
{!isOpen && hasSubmenu ? <ArrowRightIcon fontSize="small" /> : <></>}
</Box>
);