Skip to content

Commit

Permalink
docs: revise storefront development guide (#10522)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser authored Dec 10, 2024
1 parent ed9bc1f commit 096f1c2
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 32 deletions.
16 changes: 13 additions & 3 deletions www/apps/resources/app/storefront-development/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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"]} />
2 changes: 1 addition & 1 deletion www/apps/resources/generated/edit-dates.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
35 changes: 20 additions & 15 deletions www/apps/resources/generated/sidebar.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
25 changes: 14 additions & 11 deletions www/apps/resources/sidebar.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 8 additions & 2 deletions www/packages/docs-ui/src/components/ChildDocs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -170,6 +174,7 @@ export const ChildDocs = ({
})) || []
}
/>
{key !== filteredItems.length - 1 && <Hr />}
</>
)}
{!HeadingComponent && item.type === "link" && (
Expand All @@ -178,6 +183,7 @@ export const ChildDocs = ({
</React.Fragment>
)
})
}

const getElms = (items?: SidebarItem[]) => {
return onlyTopLevel ? getTopLevelElms(items) : getAllLevelsElms(items)
Expand Down

0 comments on commit 096f1c2

Please sign in to comment.