Skip to content

Commit

Permalink
fix(SideNav): empty padding in banner
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabhdaware committed Jan 8, 2025
1 parent 94cf1d2 commit 4e0e369
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions packages/blade/src/components/SideNav/SideNav.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ const getL1MenuClassName = ({
return '';
};

const BannerContainer = styled(BaseBox)((props) => {
return {
'&:not(:empty)': {
borderBottom: props.theme.border.width.thin,
borderBottomStyle: 'solid',
borderBottomColor: props.theme.colors.surface.border.gray.muted,
borderRight: props.theme.border.width.thin,
borderRightStyle: 'solid',
borderRightColor: props.theme.colors.surface.border.gray.muted,
padding: props.theme.spacing[3],
maxHeight: '100px',
width: '100%',
},
};
});

/**
* ### SideNav component
*
Expand Down Expand Up @@ -200,6 +216,8 @@ const _SideNav = (
};
}, []);

// const hasBanner = banner?.type && typeof banner.type === 'function' ? banner.type() : banner;

return (
<SideNavContext.Provider value={contextValue}>
{isMobile && onDismiss ? (
Expand Down Expand Up @@ -253,19 +271,7 @@ const _SideNav = (
{...getStyledProps(rest)}
{...makeAnalyticsAttribute(rest)}
>
{banner ? (
<BaseBox
borderBottom="thin"
borderBottomColor="surface.border.gray.muted"
borderRight="thin"
borderRightColor="surface.border.gray.muted"
padding="spacing.3"
maxHeight="100px"
width="100%"
>
{banner}
</BaseBox>
) : null}
{banner ? <BannerContainer>{banner}</BannerContainer> : null}
<BaseBox position="relative" display="block" flex="1" width="100%">
<BaseBox
position="absolute"
Expand Down

0 comments on commit 4e0e369

Please sign in to comment.