From a84a7582c0930c8aaacf39750d0194129467fcb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Fri, 31 May 2024 12:47:00 +0200 Subject: [PATCH] Collapse --- .../src/app/_components/docs/DocsSideBar.tsx | 6 +++++- .../src/app/_components/docs/DocsSidebarSection.tsx | 4 ++-- .../src/content/developers/constants/DocsIndex.ts | 11 ++--------- .../content/user-guide/constants/UserGuideIndex.ts | 3 +++ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/twenty-website/src/app/_components/docs/DocsSideBar.tsx b/packages/twenty-website/src/app/_components/docs/DocsSideBar.tsx index 5870ab8f265b..800b35e00f68 100644 --- a/packages/twenty-website/src/app/_components/docs/DocsSideBar.tsx +++ b/packages/twenty-website/src/app/_components/docs/DocsSideBar.tsx @@ -89,7 +89,11 @@ const DocsSidebar = ({ docsIndex }: { docsIndex: DocsArticlesProps[] }) => { router.push( - section.name === 'User Guide' ? '/user-guide' : path, + section.name === 'User Guide' + ? '/user-guide' + : section.name === 'Developers' + ? '/developers' + : path, ) } > diff --git a/packages/twenty-website/src/app/_components/docs/DocsSidebarSection.tsx b/packages/twenty-website/src/app/_components/docs/DocsSidebarSection.tsx index fe0aa8fc1c4c..d27ea72620e9 100644 --- a/packages/twenty-website/src/app/_components/docs/DocsSidebarSection.tsx +++ b/packages/twenty-website/src/app/_components/docs/DocsSidebarSection.tsx @@ -121,7 +121,7 @@ const DocsSidebarSection = ({ const [unfolded, setUnfolded] = useState(() => Object.keys(topics).reduce((acc: TopicsState, topic: string) => { - acc[topic] = true; + acc[topic] = false; return acc; }, {}), ); @@ -152,7 +152,7 @@ const DocsSidebarSection = ({ ) : null} - {unfolded[topic] && + {(unfolded[topic] || !hasMultipleFiles) && cards.map((card) => { const isselected = pathname === `${path}${card.fileName}`; const sectionName = card.topic diff --git a/packages/twenty-website/src/content/developers/constants/DocsIndex.ts b/packages/twenty-website/src/content/developers/constants/DocsIndex.ts index eaee915c119d..93dcb3b40da7 100644 --- a/packages/twenty-website/src/content/developers/constants/DocsIndex.ts +++ b/packages/twenty-website/src/content/developers/constants/DocsIndex.ts @@ -1,6 +1,5 @@ export const DOCS_INDEX = { - 'Getting Started': { - 'Getting Started': [{ fileName: 'index' }], + 'Getting started': { 'Local Setup': [{ fileName: 'local-setup' }], 'Self-Hosting': [ { fileName: 'self-hosting' }, @@ -45,13 +44,7 @@ export const DOCS_INDEX = { { fileName: 'queue' }, ], }, - - 'User Guide': { - 'Getting Started': [ - { fileName: 'getting-started' }, - { fileName: 'get-section' }, - ], - }, + 'User Guide': {}, /* Components: { Display: [ { fileName: 'display' }, diff --git a/packages/twenty-website/src/content/user-guide/constants/UserGuideIndex.ts b/packages/twenty-website/src/content/user-guide/constants/UserGuideIndex.ts index 7f4b1dc69023..01d436d1cbd7 100644 --- a/packages/twenty-website/src/content/user-guide/constants/UserGuideIndex.ts +++ b/packages/twenty-website/src/content/user-guide/constants/UserGuideIndex.ts @@ -29,4 +29,7 @@ export const USER_GUIDE_INDEX = { { fileName: 'github' }, ], }, + Developers: { + 'Getting started': [{ fileName: 'getting-started' }], + }, };