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
This commit is contained in:
@@ -52,23 +52,22 @@ export const navbarItemsV1: NavbarItem[] = [
|
||||
href: `/ui`,
|
||||
},
|
||||
},
|
||||
// TODO enable them later
|
||||
// {
|
||||
// type: "divider",
|
||||
// },
|
||||
// {
|
||||
// type: "link",
|
||||
// props: {
|
||||
// label: "Learn Medusa v2",
|
||||
// target: "_blank",
|
||||
// rel: "noreferrer",
|
||||
// href: `/v2`,
|
||||
// badge: {
|
||||
// variant: "blue",
|
||||
// children: "New",
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
{
|
||||
type: "divider",
|
||||
},
|
||||
{
|
||||
type: "link",
|
||||
props: {
|
||||
label: "Learn Medusa v2",
|
||||
target: "_blank",
|
||||
rel: "noreferrer",
|
||||
href: `/v2`,
|
||||
badge: {
|
||||
variant: "blue",
|
||||
children: "New",
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
export const navbarItemsV2: NavbarItem[] = [
|
||||
@@ -162,13 +161,13 @@ export const mobileSidebarItemsV1: SidebarItemType[] = [
|
||||
loaded: true,
|
||||
isPathHref: true,
|
||||
},
|
||||
// {
|
||||
// title: "Learn Medusa V2",
|
||||
// path: `/v2`,
|
||||
// loaded: true,
|
||||
// isPathHref: true,
|
||||
// additionalElms: <Badge variant="blue">v2</Badge>,
|
||||
// },
|
||||
{
|
||||
title: "Learn Medusa V2",
|
||||
path: `/v2`,
|
||||
loaded: true,
|
||||
isPathHref: true,
|
||||
additionalElms: <Badge variant="blue">v2</Badge>,
|
||||
},
|
||||
]
|
||||
|
||||
export const mobileSidebarItemsV2: SidebarItemType[] = [
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { SidebarItemType } from "types"
|
||||
import { mobileSidebarItemsV1, mobileSidebarItemsV2 } from ".."
|
||||
|
||||
type Options = {
|
||||
baseUrl: string
|
||||
version?: "v1" | "v2"
|
||||
}
|
||||
|
||||
export function getMobileSidebarItems({
|
||||
baseUrl,
|
||||
version = "v1",
|
||||
}: Options): SidebarItemType[] {
|
||||
const mobileItems =
|
||||
version === "v2" ? mobileSidebarItemsV2 : mobileSidebarItemsV1
|
||||
return mobileItems.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
path: `${baseUrl}${item.path}`,
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -5,6 +5,7 @@ export * from "./decode-str"
|
||||
export * from "./dom-utils"
|
||||
export * from "./format-report-link"
|
||||
export * from "./get-link-with-base-path"
|
||||
export * from "./get-mobile-sidebar-items"
|
||||
export * from "./get-navbar-items"
|
||||
export * from "./get-os-shortcut"
|
||||
export * from "./get-scrolled-top"
|
||||
|
||||
Reference in New Issue
Block a user