-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
b6fd82e
commit 4c89f91
Showing
13 changed files
with
100 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
}), | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
}), | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
www/packages/docs-ui/src/utils/get-mobile-sidebar-items.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}`, | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters