- Improve intro sections of API reference to utilize divided columns - Improve the content of the intro sections - Add a new Workflows section to explain the workflows badge and how to use it - Fixes to headings and add anchor for copying the link to a section - Fixes responsiveness of intro sections on mobile devices - Other: fix loading not showing when a sidebar category is opened. Closes DOCS-932, DOCS-934, DOCS-937 Preview: https://api-reference-v2-git-docs-api-ref-intro-fixes-medusajs.vercel.app/v2/api/store
31 lines
706 B
TypeScript
31 lines
706 B
TypeScript
import React from "react"
|
|
import DividedLayout, { DividedLayoutProps } from "../Divided"
|
|
|
|
type DividedMarkdownLayoutProps = {
|
|
children: React.ReactNode
|
|
} & Omit<DividedLayoutProps, "mainContent" | "codeContent">
|
|
|
|
const DividedMarkdownLayout = ({
|
|
children,
|
|
...props
|
|
}: DividedMarkdownLayoutProps) => {
|
|
const childArr = React.isValidElement(children)
|
|
? [children]
|
|
: Array.isArray(children)
|
|
? children
|
|
: []
|
|
|
|
if (!childArr.length) {
|
|
return <></>
|
|
}
|
|
|
|
const contentElm = childArr[0]
|
|
const codeElm = childArr.length > 1 ? childArr[1] : <></>
|
|
|
|
return (
|
|
<DividedLayout mainContent={contentElm} codeContent={codeElm} {...props} />
|
|
)
|
|
}
|
|
|
|
export default DividedMarkdownLayout
|