docs: improvements to API reference intro sections (#9397)
- 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
This commit is contained in:
@@ -29,18 +29,21 @@ export const SidebarItemCategory = ({
|
||||
getPersistedCategoryState,
|
||||
persistState,
|
||||
} = useSidebar()
|
||||
const itemShowLoading = useMemo(() => {
|
||||
return !item.loaded || (item.showLoadingIfEmpty && !item.children?.length)
|
||||
}, [item])
|
||||
|
||||
useEffect(() => {
|
||||
if (open && !item.loaded) {
|
||||
if (open && itemShowLoading) {
|
||||
setShowLoading(true)
|
||||
}
|
||||
}, [open])
|
||||
}, [open, itemShowLoading])
|
||||
|
||||
useEffect(() => {
|
||||
if (item.loaded && showLoading) {
|
||||
if (!itemShowLoading && showLoading) {
|
||||
setShowLoading(false)
|
||||
}
|
||||
}, [item])
|
||||
}, [itemShowLoading, showLoading])
|
||||
|
||||
useEffect(() => {
|
||||
const isActive = isChildrenActive(item)
|
||||
|
||||
Reference in New Issue
Block a user