Skip to content

Commit c65a40d

Browse files
authored
docs: fixes following content redesign (#14912)
* docs: fixes following content redesign * disable what's new and actions in bloom docs
1 parent bae27b3 commit c65a40d

File tree

7 files changed

+30
-9
lines changed

7 files changed

+30
-9
lines changed

www/apps/bloom/config/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { DocsConfig, Sidebar } from "types"
22
import { generatedSidebars } from "@/generated/sidebar.mjs"
3-
import { globalConfig } from "docs-ui"
3+
import { globalConfig, products } from "docs-ui"
44
import { basePathUrl } from "../utils/base-path-url"
55

66
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000"
@@ -34,4 +34,8 @@ export const config: DocsConfig = {
3434
features: {
3535
aiAssistant: false,
3636
},
37+
contentMenuSections: {
38+
products: false,
39+
whatsNew: false,
40+
},
3741
}

www/packages/docs-ui/src/components/ContentMenu/Actions/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { ContentMenuSection } from "../Section"
1111

1212
export const ContentMenuActions = () => {
1313
const {
14-
config: { baseUrl, basePath, features },
14+
config: { baseUrl, basePath, features, contentMenuSections },
1515
} = useSiteConfig()
1616
const pathname = usePathname()
1717
const { setChatOpened } = useAiAssistant()
@@ -31,7 +31,12 @@ export const ContentMenuActions = () => {
3131
}
3232

3333
return (
34-
<ContentMenuSection title="Shortcuts">
34+
<ContentMenuSection
35+
title="Shortcuts"
36+
hideChildrenDivider={
37+
!contentMenuSections?.products && !contentMenuSections?.whatsNew
38+
}
39+
>
3540
<div className="flex flex-col gap-docs_0.5 p-docs_1">
3641
<Link
3742
className="flex items-center gap-docs_0.5 text-medusa-fg-subtle text-x-small-plus hover:text-medusa-fg-base"

www/packages/docs-ui/src/components/ContentMenu/Products/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ export const ContentMenuProducts = () => {
3535
}
3636

3737
return (
38-
<ContentMenuSection title="Modules used">
38+
<ContentMenuSection
39+
title="Modules used"
40+
hideChildrenDivider={!config.contentMenuSections?.whatsNew}
41+
>
3942
<div className="flex flex-col gap-docs_0.5 p-docs_1">
4043
<span className="text-x-small-plus text-medusa-fg-muted">
4144
Modules used

www/packages/docs-ui/src/components/ContentMenu/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ import { ContentMenuProducts } from "./Products"
88
import { useLayout } from "../../providers/Layout"
99
import { ShadedBlock } from "../ShadedBlock"
1010
import { ContentMenuWhatsNew } from "./WhatsNew"
11+
import { useSiteConfig } from "../../providers/SiteConfig"
1112

1213
export const ContentMenu = () => {
1314
const { showCollapsedNavbar } = useLayout()
15+
const { config } = useSiteConfig()
1416

1517
return (
1618
<div
@@ -26,8 +28,8 @@ export const ContentMenu = () => {
2628
<div className="flex flex-col flex-1 overflow-hidden">
2729
<ContentMenuToc />
2830
<ContentMenuActions />
29-
<ContentMenuProducts />
30-
<ContentMenuWhatsNew />
31+
{config.contentMenuSections?.products && <ContentMenuProducts />}
32+
{config.contentMenuSections?.whatsNew && <ContentMenuWhatsNew />}
3133
<div className="p-docs_1">
3234
<ShadedBlock className="!h-docs_2" />
3335
</div>

www/packages/docs-ui/src/layouts/main-content.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ export const MainContentLayout = ({
7070
{desktopSidebarOpen ? "Hide sidebar" : "Show sidebar"}
7171
</span>
7272
<Kbd>{osShortcut}</Kbd>
73-
<Kbd>/</Kbd>
73+
<Kbd>\</Kbd>
7474
</div>
7575
)}
7676
className={clsx(
77-
"hidden lg:block absolute h-[20px] w-[3px] top-1/2 -translate-y-1/2 z-10",
77+
"hidden lg:block absolute h-[20px] w-[3px] top-1/2 -translate-y-1/2 z-20",
7878
className
7979
)}
8080
innerClassName="w-full h-full inline-block"
@@ -133,7 +133,9 @@ export const MainContentLayout = ({
133133
{/* Sidebar + content menu collapser */}
134134
{showContentMenu && (
135135
<>
136-
{sidebarCollapser("right-[225px]")}
136+
{sidebarCollapser(
137+
desktopSidebarOpen ? "right-[225px]" : "right-docs_0.25"
138+
)}
137139
{desktopSidebarOpen && <ContentMenu />}
138140
</>
139141
)}

www/packages/docs-ui/src/providers/SiteConfig/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ export const SiteConfigProvider = ({
4848
features: {
4949
aiAssistant: true,
5050
},
51+
contentMenuSections: {
52+
products: true,
53+
whatsNew: true,
54+
},
5155
},
5256
globalConfig,
5357
initConfig || {}

www/packages/types/src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ export declare type DocsConfig = {
3535
features?: {
3636
aiAssistant?: boolean
3737
}
38+
contentMenuSections?: Record<string, boolean>
3839
}

0 commit comments

Comments
 (0)