mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-02 19:57:25 +02:00
fix(v2): hide mobile collapsible doc toc if no headings (#5172)
This commit is contained in:
parent
818fb3956b
commit
0851e0e5bf
1 changed files with 5 additions and 6 deletions
|
@ -56,15 +56,14 @@ function DocItem(props: Props): JSX.Element {
|
||||||
|
|
||||||
const windowSize = useWindowSize();
|
const windowSize = useWindowSize();
|
||||||
|
|
||||||
|
const canRenderTOC =
|
||||||
|
!hideTableOfContents && DocContent.toc && DocContent.toc.length > 0;
|
||||||
|
|
||||||
const renderTocMobile =
|
const renderTocMobile =
|
||||||
!hideTableOfContents &&
|
canRenderTOC && (windowSize === 'mobile' || windowSize === 'ssr');
|
||||||
DocContent.toc &&
|
|
||||||
(windowSize === 'mobile' || windowSize === 'ssr');
|
|
||||||
|
|
||||||
const renderTocDesktop =
|
const renderTocDesktop =
|
||||||
!hideTableOfContents &&
|
canRenderTOC && (windowSize === 'desktop' || windowSize === 'ssr');
|
||||||
DocContent.toc &&
|
|
||||||
(windowSize === 'desktop' || windowSize === 'ssr');
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
Loading…
Add table
Reference in a new issue