- Fix text of download button - Small fix to styling on small devies - Fix mobile sidebar items using incorrect base url
30 lines
720 B
TypeScript
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",
|
|
}),
|
|
}
|
|
}
|