Skip to content

Commit

Permalink
Collapse
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMalfait committed May 31, 2024
1 parent 54747c7 commit 85e66d0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ const DocsSidebar = ({ docsIndex }: { docsIndex: DocsArticlesProps[] }) => {
<StyledHeadingText
onClick={() =>
router.push(
section.name === 'User Guide' ? '/user-guide' : path,
section.name === 'User Guide'
? '/user-guide'
: section.name === 'Developers'
? '/developers'
: path,
)
}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const DocsSidebarSection = ({

const [unfolded, setUnfolded] = useState<TopicsState>(() =>
Object.keys(topics).reduce((acc: TopicsState, topic: string) => {
acc[topic] = true;
acc[topic] = false;
return acc;
}, {}),
);
Expand Down Expand Up @@ -152,7 +152,7 @@ const DocsSidebarSection = ({
</StyledTitle>
) : null}

{unfolded[topic] &&
{(unfolded[topic] || !hasMultipleFiles) &&
cards.map((card) => {
const isselected = pathname === `${path}${card.fileName}`;
const sectionName = card.topic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,8 @@ export const DOCS_INDEX = {
{ fileName: 'queue' },
],
},

'User Guide': {
'Getting Started': [
{ fileName: 'getting-started' },
{ fileName: 'get-section' },
],
'Getting Started': [{ fileName: 'getting-started' }],
},
/* Components: {
Display: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ export const USER_GUIDE_INDEX = {
{ fileName: 'github' },
],
},
Developers: {
'Getting started': [{ fileName: 'getting-started' }],
},
};

0 comments on commit 85e66d0

Please sign in to comment.