From b9c901b58e42bcc333f55943682f2f2c039f67de Mon Sep 17 00:00:00 2001 From: Benjamin Cabanes <3447705+bcabanes@users.noreply.github.com> Date: Mon, 3 Apr 2023 12:15:30 -0400 Subject: [PATCH] feat(nx-dev): display toc for smaller viewport sizes (#16061) --- .../feature-doc-viewer/src/lib/doc-viewer.tsx | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 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 7d889fbd946f3..dfd1f2508dd01 100644 --- a/nx-dev/feature-doc-viewer/src/lib/doc-viewer.tsx +++ b/nx-dev/feature-doc-viewer/src/lib/doc-viewer.tsx @@ -8,6 +8,7 @@ import { Breadcrumbs, Footer } from '@nrwl/nx-dev/ui-common'; import { renderMarkdown } from '@nrwl/nx-dev/ui-markdoc'; import { NextSeo } from 'next-seo'; import { useRouter } from 'next/router'; +import { cx } from 'nx-dev/ui-primitives'; import { useRef } from 'react'; import { collectHeadings, TableOfContents } from './table-of-contents'; @@ -19,6 +20,7 @@ export function DocViewer({ relatedDocuments: RelatedDocument[]; }): JSX.Element { const router = useRouter(); + const isIntro = router.asPath.includes('/getting-started/intro'); const ref = useRef(null); const { metadata, node, treeNode } = renderMarkdown( @@ -86,17 +88,26 @@ export function DocViewer({
{vm.content}
-
- -
+ {!isIntro && ( + + )} {/*RELATED CONTENT*/}