mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-01 00:48:02 +02:00
refactor: split and cleanup theme/DocPage (#7006)
This commit is contained in:
parent
2964e6f65d
commit
1b974e8b1b
10 changed files with 299 additions and 163 deletions
|
@ -105,7 +105,7 @@ export function useCurrentSidebarCategory(): PropSidebarItemCategory {
|
|||
if (!sidebar) {
|
||||
throw new Error('Unexpected: cant find current sidebar in context');
|
||||
}
|
||||
const category = findSidebarCategory(sidebar, (item) =>
|
||||
const category = findSidebarCategory(sidebar.items, (item) =>
|
||||
isSamePath(item.href, pathname),
|
||||
);
|
||||
if (!category) {
|
||||
|
@ -174,7 +174,7 @@ export function useSidebarBreadcrumbs(): PropSidebarBreadcrumbsItem[] | null {
|
|||
return false;
|
||||
}
|
||||
|
||||
extract(sidebar);
|
||||
extract(sidebar.items);
|
||||
|
||||
return breadcrumbs.reverse();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue