docs: revise storefront development guide (#10522)

This commit is contained in:
Shahed Nasser
2024-12-10 12:33:52 +02:00
committed by GitHub
parent ed9bc1f1c4
commit 096f1c2a9b
5 changed files with 56 additions and 32 deletions
@@ -6,8 +6,18 @@ export const metadata = {
# {metadata.title}
This section of the documentation holds guides to help you build a storefront for your Medusa application.
The Medusa application is made up of a Node.js service and an admin dashboard. The storefront is installed, built, and hosted separately from the Medusa application, providing you with the flexibility to choose the frontend tech stack that you and your team are proficient in, and implement unique design systems and user experience.
<ChildDocs onlyTopLevel={true} showItems={["Tips", "Publishable API Key"]} />
<Note>
<ChildDocs hideItems={["Tips", "Publishable API Key"]} />
Learn more about Medusa's architecture in [this documentation](!docs!/learn/introduction/architecture).
</Note>
You can build your storefront from scratch, or built it on top of the [Next.js Starter storefront](../nextjs-starter/page.mdx). This section of the documentation provides guides to help you build a storefront from scratch for your Medusa application.
<ChildDocs showItems={["General"]} />
---
<ChildDocs hideItems={["General"]} />
+1 -1
View File
@@ -193,7 +193,7 @@ export const generatedEditDates = {
"app/storefront-development/regions/store-retrieve-region/page.mdx": "2024-09-11T10:07:42.887Z",
"app/storefront-development/regions/page.mdx": "2024-06-09T15:19:09+02:00",
"app/storefront-development/tips/page.mdx": "2024-10-22T11:01:01.298Z",
"app/storefront-development/page.mdx": "2024-06-09T15:19:09+02:00",
"app/storefront-development/page.mdx": "2024-12-10T09:23:20.666Z",
"app/troubleshooting/cors-errors/page.mdx": "2024-05-03T17:36:38+03:00",
"app/troubleshooting/create-medusa-app-errors/page.mdx": "2024-07-11T10:29:13+03:00",
"app/troubleshooting/database-errors/page.mdx": "2024-05-03T17:36:38+03:00",
+20 -15
View File
@@ -8092,21 +8092,26 @@ export const generatedSidebar = [
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/storefront-development/tips",
"title": "Tips",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/storefront-development/publishable-api-keys",
"title": "Publishable API Key",
"children": []
},
{
"type": "separator"
"type": "category",
"title": "General",
"children": [
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/storefront-development/tips",
"title": "Tips",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/storefront-development/publishable-api-keys",
"title": "Publishable API Key",
"children": []
}
]
},
{
"loaded": true,
+14 -11
View File
@@ -1818,17 +1818,20 @@ export const sidebar = sidebarAttachHrefCommonOptions([
isChildSidebar: true,
children: [
{
type: "link",
path: "/storefront-development/tips",
title: "Tips",
},
{
type: "link",
path: "/storefront-development/publishable-api-keys",
title: "Publishable API Key",
},
{
type: "separator",
type: "category",
title: "General",
children: [
{
type: "link",
path: "/storefront-development/tips",
title: "Tips",
},
{
type: "link",
path: "/storefront-development/publishable-api-keys",
title: "Publishable API Key",
},
],
},
{
type: "category",
@@ -4,6 +4,9 @@ import React, { useMemo } from "react"
import { Card, CardList, H2, useSidebar } from "../.."
import { InteractiveSidebarItem, SidebarItem, SidebarItemLink } from "types"
import slugify from "slugify"
import { MDXComponents } from "../.."
const Hr = MDXComponents["hr"] as () => React.JSX.Element
type ChildDocsProps = {
onlyTopLevel?: boolean
@@ -148,8 +151,9 @@ export const ChildDocs = ({
)
}
const getAllLevelsElms = (items?: SidebarItem[]) =>
filterNonInteractiveItems(items).map((item, key) => {
const getAllLevelsElms = (items?: SidebarItem[]) => {
const filteredItems = filterNonInteractiveItems(items)
return filteredItems.map((item, key) => {
const itemChildren = getChildrenForLevel(item)
const HeadingComponent = itemChildren?.length ? H2 : undefined
@@ -170,6 +174,7 @@ export const ChildDocs = ({
})) || []
}
/>
{key !== filteredItems.length - 1 && <Hr />}
</>
)}
{!HeadingComponent && item.type === "link" && (
@@ -178,6 +183,7 @@ export const ChildDocs = ({
</React.Fragment>
)
})
}
const getElms = (items?: SidebarItem[]) => {
return onlyTopLevel ? getTopLevelElms(items) : getAllLevelsElms(items)