{item.title}
-
+
+
-
-
+
From e16851ab1c1ad8aa93e7475c03115b675e53f7cb Mon Sep 17 00:00:00 2001 From: "Josh Berman [SSW]" <137844305+joshbermanssw@users.noreply.github.com> Date: Fri, 10 Jan 2025 15:51:10 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=8F=20Move=20docs=20from=20pages=20to?= =?UTF-8?q?=20app=20router=20(#2712)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Move docs from pages to app router * fix import * fix more imports * fix products page * add hover to navy * added TODO --- app/docs/[...slug]/DocsPagesClient.tsx | 113 ++++++ app/docs/[...slug]/page.tsx | 74 ++++ app/docs/page.tsx | 37 ++ app/tina-client.tsx | 25 ++ app/whats-new/tinacms/page.tsx | 3 +- .../DocsNavigationList.tsx | 294 +++++++++++++++ .../DocumentationNavigation/Breadcrumbs.tsx | 58 +++ .../DocumentationNavigation/DocsHeaderNav.tsx | 41 +++ .../DocsLeftSidebar.tsx | 68 ++++ .../DocsNavigationList.tsx | 285 +++++++++++++++ .../DocumentationNavigation.tsx | 124 +++++++ .../DocumentationNavigation/VersionSelect.tsx | 137 +++++++ .../Docs/DocumentationNavigation/index.tsx | 1 + .../Docs/docsMain/directoryOverflowButton.tsx | 50 +++ .../Docs/docsMain/docsMainBody.tsx | 22 ++ .../Docs/docsMain/docsMobileHeader.tsx | 77 ++++ .../Docs/docsMain/tocOverflowButton.tsx | 73 ++++ .../Docs/docsSearch/SearchComponent.tsx | 194 ++++++++++ .../Docs/docsSearch/SearchNavigation.tsx | 281 +++++++++++++++ .../Docs/toc/index.tsx | 194 ++++++++++ .../Docs/toc/toc-item.template.tsx | 15 + .../Docs/toc/toc-submenu.template.tsx | 36 ++ .../Docs/toc_helper.ts | 66 ++++ .../DocsNavigationList.tsx | 1 - components/blocks/CardGrid.tsx | 113 ++---- components/docsMain/docsMainBody.tsx | 1 - components/hooks/ScreenResizer.tsx | 21 ++ components/layout/Footer.tsx | 3 - .../docAndBlogComponents.tsx | 2 +- .../scrollBasedShowcase.tsx | 336 ++++++------------ components/toc/index.tsx | 1 + pages/docs/[...slug].tsx | 321 ----------------- pages/docs/index.tsx | 12 - 33 files changed, 2425 insertions(+), 654 deletions(-) create mode 100644 app/docs/[...slug]/DocsPagesClient.tsx create mode 100644 app/docs/[...slug]/page.tsx create mode 100644 app/docs/page.tsx create mode 100644 app/tina-client.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/DocumentationNavigation copy/DocsNavigationList.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/DocumentationNavigation/Breadcrumbs.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/DocumentationNavigation/DocsHeaderNav.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/DocumentationNavigation/DocsLeftSidebar.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/DocumentationNavigation/DocsNavigationList.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/DocumentationNavigation/DocumentationNavigation.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/DocumentationNavigation/VersionSelect.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/DocumentationNavigation/index.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/docsMain/directoryOverflowButton.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/docsMain/docsMainBody.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/docsMain/docsMobileHeader.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/docsMain/tocOverflowButton.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/docsSearch/SearchComponent.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/docsSearch/SearchNavigation.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/toc/index.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/toc/toc-item.template.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/toc/toc-submenu.template.tsx create mode 100644 components/AppRouterMigrationComponents/Docs/toc_helper.ts create mode 100644 components/hooks/ScreenResizer.tsx delete mode 100644 pages/docs/[...slug].tsx delete mode 100644 pages/docs/index.tsx diff --git a/app/docs/[...slug]/DocsPagesClient.tsx b/app/docs/[...slug]/DocsPagesClient.tsx new file mode 100644 index 0000000000..642550a881 --- /dev/null +++ b/app/docs/[...slug]/DocsPagesClient.tsx @@ -0,0 +1,113 @@ +'use client'; + +import MainDocsBodyHeader from 'components/AppRouterMigrationComponents/Docs/docsMain/docsMainBody'; +import TocOverflowButton from 'components/AppRouterMigrationComponents/Docs/docsMain/tocOverflowButton'; +import { LeftHandSideParentContainer } from 'components/AppRouterMigrationComponents/Docs/docsSearch/SearchNavigation'; +import ToC from 'components/AppRouterMigrationComponents/Docs/toc'; +import { screenResizer } from 'components/hooks/ScreenResizer'; +import { docAndBlogComponents } from 'components/tinaMarkdownComponents/docAndBlogComponents'; +import { DocsPagination } from 'components/ui'; +import { TinaMarkdown } from 'tinacms/dist/rich-text'; +import { useTocListener } from 'components/AppRouterMigrationComponents/Docs/toc_helper'; + +export default function DocsClient(props) { + + const { PageTableOfContents, NavigationDocsData } = props.props; + const DocumentationData = props.tinaProps.data.doc; + + const allData = [DocumentationData, PageTableOfContents, NavigationDocsData]; + + + const isScreenSmallerThan1200 = screenResizer().isScreenSmallerThan1200; + const isScreenSmallerThan840 = screenResizer().isScreenSmallerThan840; + const { activeIds, contentRef } = useTocListener(DocumentationData); + + const previousPage = { + slug: DocumentationData?.previous?.id.slice(7, -4), + title: DocumentationData?.previous?.title, + }; + + const nextPage = { + slug: DocumentationData?.next?.id.slice(7, -4), + title: DocumentationData?.next?.title, + }; + + + + const lastEdited = DocumentationData?.last_edited; + const date = lastEdited === null ? null : new Date(lastEdited); + const formattedDate = date + ? date.toLocaleDateString('en-US', { + year: 'numeric', + month: 'long', + day: 'numeric', + }) + : ''; + const gridClass = isScreenSmallerThan840 + ? 'grid-cols-1' + : isScreenSmallerThan1200 + ? 'grid-cols-[1.25fr_3fr]' + : 'grid-cols-[1.25fr_3fr_0.75fr]'; + + + + return ( +
+ {highlightText(item._highlightResult.excerpt?.value || '')} +
+ ++ {highlightText(item._highlightResult.excerpt?.value || '')} +
+ +{card.description}
- - {card.linkText && ( -{card.description}
+ + {card.linkText && ( +