diff --git a/packages/docusaurus-theme-classic/src/theme/DocCard/index.tsx b/packages/docusaurus-theme-classic/src/theme/DocCard/index.tsx index de65d3d642..15c8ac155d 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocCard/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/DocCard/index.tsx @@ -22,20 +22,15 @@ function CardContainer({ href, children, }: { - href?: string; + href: string; children: ReactNode; }): JSX.Element { - const className = clsx( - 'card margin-bottom--lg padding--lg', - styles.cardContainer, - href && styles.cardContainerLink, - ); - return href ? ( - + return ( + {children} - ) : ( -
+ {description} +
+ )} ); } -function CardCategory({item}: {item: PropSidebarItemCategory}): JSX.Element { +function CardCategory({ + item, +}: { + item: PropSidebarItemCategory; +}): JSX.Element | null { const href = findFirstCategoryLink(item); + + // Unexpected: categories that don't have a link have been filtered upfront + if (!href) { + return null; + } + return (