From fc5fd2dcd4f2c49cedf91b491108037ceacb0d26 Mon Sep 17 00:00:00 2001 From: Ben <3447705+bcabanes@users.noreply.github.com> Date: Sun, 16 Jul 2023 15:38:36 -0400 Subject: [PATCH] fix(nx-dev): hide toc on reference pages --- nx-dev/feature-doc-viewer/src/lib/doc-viewer.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nx-dev/feature-doc-viewer/src/lib/doc-viewer.tsx b/nx-dev/feature-doc-viewer/src/lib/doc-viewer.tsx index f11eea3e17085..5e6bc9565150e 100644 --- a/nx-dev/feature-doc-viewer/src/lib/doc-viewer.tsx +++ b/nx-dev/feature-doc-viewer/src/lib/doc-viewer.tsx @@ -20,9 +20,11 @@ export function DocViewer({ relatedDocuments: RelatedDocument[]; }): JSX.Element { const router = useRouter(); - const isIntroPage = + const hideTableOfContent = router.asPath.includes('/getting-started/intro') || - router.asPath.includes('/plugins/intro/getting-started'); + router.asPath.includes('/plugins/intro/getting-started') || + router.asPath.includes('/packages/devkit') || + router.asPath.includes('/reference/glossary'); const ref = useRef(null); const { metadata, node, treeNode } = renderMarkdown( @@ -92,12 +94,12 @@ export function DocViewer({ data-document="main" className={cx( 'prose prose-slate dark:prose-invert w-full max-w-none 2xl:max-w-4xl', - { 'xl:max-w-2xl': !isIntroPage } + { 'xl:max-w-2xl': !hideTableOfContent } )} > {vm.content} - {!isIntroPage && ( + {!hideTableOfContent && (