mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-29 13:33:06 +00:00
feat(theme): Allow custom icon in DocCard component
This commit is contained in:
parent
c6c0f636a8
commit
75e9502483
|
|
@ -113,7 +113,9 @@ function CardCategory({item}: {item: PropSidebarItemCategory}): ReactNode {
|
|||
}
|
||||
|
||||
function CardLink({item}: {item: PropSidebarItemLink}): ReactNode {
|
||||
const icon = isInternalUrl(item.href) ? '📄️' : '🔗';
|
||||
const defaultIcon = isInternalUrl(item.href) ? '📄' : '🔗';
|
||||
const customIcon = item.icon && item.icon !== '';
|
||||
const icon = customIcon ? item.icon : defaultIcon;
|
||||
const doc = useDocById(item.docId ?? undefined);
|
||||
return (
|
||||
<CardLayout
|
||||
|
|
|
|||
Loading…
Reference in New Issue