Files
medusa-store/www/apps/book/config/sidebar.tsx
Shahed Nasser 4c89f91caf docs: fix download button + other fixes (#8032)
- Fix text of download button
- Small fix to styling on small devies
- Fix mobile sidebar items using incorrect base url
2024-07-09 12:36:02 +00:00

30 lines
720 B
TypeScript

import { Badge, getMobileSidebarItems } from "docs-ui"
import type { SidebarConfig, SidebarItemType } from "@/types"
import { sidebar } from "../sidebar.mjs"
const soonBadge = <Badge variant="blue">Soon</Badge>
const normalizeSidebarItems = (items: SidebarItemType[]) =>
items.map((item) => {
if (item.isSoon) {
item.additionalElms = soonBadge
}
if (item.children) {
item.children = normalizeSidebarItems(item.children as SidebarItemType[])
}
return item
})
export const sidebarConfig = (baseUrl: string): SidebarConfig => {
return {
top: normalizeSidebarItems(sidebar),
bottom: [],
mobile: getMobileSidebarItems({
baseUrl,
version: "v2",
}),
}
}