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:
Shahed Nasser authored and GitHub committed 2024-07-09 12:36:02 +00:00
1 parent b6fd82e31e
commit 4c89f91caf
13 files changed
+100 -46

No files matched your search

+5 -1
View File
@@ -22,7 +22,11 @@ const ReferencePage = async () => {
<AdminContentV2 />
</Section>
}
codeContent={<ClientLibrariesV2 />}
codeContent={
<div className="mb-1 lg:mb-0">
<ClientLibrariesV2 />
</div>
}
className="flex-col-reverse"
/>
<Tags />
+5 -1
View File
@@ -22,7 +22,11 @@ const ReferencePage = async () => {
<StoreContentV2 />
</Section>
}
codeContent={<ClientLibrariesV2 />}
codeContent={
<div className="mb-1 lg:mb-0">
<ClientLibrariesV2 />
</div>
}
className="flex-col-reverse"
/>
<Tags />
@@ -14,7 +14,7 @@ const DownloadFull = () => {
download
target="_blank"
>
Download openapi.yaml
Download OpenApi Specs Collection
</Link>
</Button>
)
+8 -3
View File
@@ -1,8 +1,10 @@
import { DocsConfig } from "types"
import { mobileSidebarItemsV2 } from "docs-ui"
import { getMobileSidebarItems } from "docs-ui"
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000"
export const config: DocsConfig = {
baseUrl: process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000",
baseUrl,
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
// sidebar is auto generated
sidebar: {
@@ -14,6 +16,9 @@ export const config: DocsConfig = {
},
],
bottom: [],
mobile: mobileSidebarItemsV2,
mobile: getMobileSidebarItems({
baseUrl,
version: "v2",
}),
},
}
+1 -1
View File
@@ -13,7 +13,7 @@ const Navbar = () => {
() =>
getNavbarItems({
basePath: config.baseUrl,
activePath: basePathUrl(""),
activePath: basePathUrl(),
version: "v2",
}),
[]
+4 -2
View File
@@ -1,9 +1,11 @@
import { DocsConfig } from "types"
import { sidebarConfig } from "./sidebar"
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000"
export const config: DocsConfig = {
titleSuffix: "Medusa v2 Docs",
baseUrl: process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000",
baseUrl,
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
sidebar: sidebarConfig,
sidebar: sidebarConfig(baseUrl),
}
+10 -5
View File
@@ -1,4 +1,4 @@
import { Badge, mobileSidebarItemsV2 } from "docs-ui"
import { Badge, getMobileSidebarItems } from "docs-ui"
import type { SidebarConfig, SidebarItemType } from "@/types"
import { sidebar } from "../sidebar.mjs"
@@ -17,8 +17,13 @@ const normalizeSidebarItems = (items: SidebarItemType[]) =>
return item
})
export const sidebarConfig: SidebarConfig = {
top: normalizeSidebarItems(sidebar),
bottom: [],
mobile: mobileSidebarItemsV2,
export const sidebarConfig = (baseUrl: string): SidebarConfig => {
return {
top: normalizeSidebarItems(sidebar),
bottom: [],
mobile: getMobileSidebarItems({
baseUrl,
version: "v2",
}),
}
}
+8 -3
View File
@@ -1,14 +1,19 @@
import { DocsConfig } from "types"
import { mobileSidebarItemsV2 } from "docs-ui"
import { getMobileSidebarItems } from "docs-ui"
import { generatedSidebar } from "../generated/sidebar.mjs"
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000"
export const config: DocsConfig = {
titleSuffix: "Medusa Learning Resources",
baseUrl: process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000",
baseUrl,
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
sidebar: {
top: generatedSidebar,
bottom: [],
mobile: mobileSidebarItemsV2,
mobile: getMobileSidebarItems({
baseUrl,
version: "v2",
}),
},
}
+5 -2
View File
@@ -1,5 +1,5 @@
import { ArrowUpRightOnBox } from "@medusajs/icons"
import { NavbarItem, getNavbarItems, mobileSidebarItemsV1 } from "docs-ui"
import { NavbarItem, getMobileSidebarItems, getNavbarItems } from "docs-ui"
import { SidebarSectionItemsType } from "types"
import { siteConfig } from "./site"
@@ -280,6 +280,9 @@ export const docsConfig: DocsConfig = {
],
},
],
mobile: mobileSidebarItemsV1,
mobile: getMobileSidebarItems({
baseUrl: siteConfig.baseUrl,
version: "v1",
}),
},
}
+8 -3
View File
@@ -1,14 +1,19 @@
import { DocsConfig } from "types"
import { mobileSidebarItemsV2 } from "docs-ui"
import { getMobileSidebarItems } from "docs-ui"
import { generatedSidebar as sidebar } from "@/generated/sidebar.mjs"
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000"
export const config: DocsConfig = {
titleSuffix: "Medusa Admin User Guide",
baseUrl: process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000",
baseUrl,
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
sidebar: {
top: sidebar,
bottom: [],
mobile: mobileSidebarItemsV2,
mobile: getMobileSidebarItems({
baseUrl,
version: "v2",
}),
},
}