Skip to content

Commit b0d6c28

Browse files
author
Carla Goncalves
committed
Update spacing for orm
1 parent e181c9a commit b0d6c28

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/theme/DocSidebar/Desktop/Content/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function useShowAnnouncementBar() {
2323
return isActive && showAnnouncementBar;
2424
}
2525

26-
export default function DocSidebarDesktopContent({ path, sidebar, className }: Props): JSX.Element {
26+
export default function DocSidebarDesktopContent({ path, sidebar, className, promo }: Props & { promo: boolean }): JSX.Element {
2727
const showAnnouncementBar = useShowAnnouncementBar();
2828

2929
return (
@@ -36,6 +36,7 @@ export default function DocSidebarDesktopContent({ path, sidebar, className }: P
3636
className={clsx(
3737
"menu thin-scrollbar",
3838
styles.menu,
39+
promo && styles.hasPromo,
3940
showAnnouncementBar && styles.menuWithAnnouncementBar,
4041
className
4142
)}

src/theme/DocSidebar/Desktop/Content/styles.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@
1313
.menuWithAnnouncementBar {
1414
margin-bottom: var(--docusaurus-announcement-bar-height);
1515
}
16+
17+
.hasPromo {
18+
margin-top: -16px;
19+
}
1620
}

src/theme/DocSidebar/Desktop/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function DocSidebarDesktop({ path, sidebar, onCollapse, isHidden }: Props) {
1919
} = useThemeConfig();
2020

2121
let location = useLocation();
22-
22+
const hasPromo = (location.pathname.split("/")[1] == "orm" || location.pathname.split("/")[2] == "orm");
2323
return (
2424
<div
2525
className={clsx(
@@ -29,10 +29,10 @@ function DocSidebarDesktop({ path, sidebar, onCollapse, isHidden }: Props) {
2929
)}
3030
>
3131
{hideOnScroll && <Logo tabIndex={-1} className={styles.sidebarLogo} />}
32-
{(location.pathname.split("/")[1] == "orm" || location.pathname.split("/")[2] == "orm") && (
32+
{hasPromo && (
3333
<Promo />
3434
)}
35-
<Content path={path} sidebar={sidebar} />
35+
<Content path={path} sidebar={sidebar} promo={hasPromo} />
3636
{hideable && <CollapseButton onClick={onCollapse} />}
3737
</div>
3838
);

0 commit comments

Comments
 (0)