diff --git a/src/components/UI/docs/DocsLinks.tsx b/src/components/UI/docs/DocsLinks.tsx index 10ae276192..509236f7d9 100644 --- a/src/components/UI/docs/DocsLinks.tsx +++ b/src/components/UI/docs/DocsLinks.tsx @@ -19,9 +19,10 @@ import { NavLink } from '../../../types'; interface Props { navLinks: NavLink[]; + toggleMobileAccordion: () => void; } -export const DocsLinks: FC = ({ navLinks }) => { +export const DocsLinks: FC = ({ navLinks, toggleMobileAccordion }) => { const router = useRouter(); const { slug } = router.query; return ( @@ -53,7 +54,7 @@ export const DocsLinks: FC = ({ navLinks }) => { > {to ? ( - + = ({ navLinks }) => { {items && ( - + )} diff --git a/src/components/UI/docs/DocsNav.tsx b/src/components/UI/docs/DocsNav.tsx index 3dcb661d4e..91f8d37ce3 100644 --- a/src/components/UI/docs/DocsNav.tsx +++ b/src/components/UI/docs/DocsNav.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import { FC, useState } from 'react'; import { Accordion, AccordionButton, @@ -17,14 +17,20 @@ interface Props { } export const DocsNav: FC = ({ navLinks }) => { + const [isMobileAccordionOpen, setMobileAccordionState] = useState(false) + + const toggleMobileAccordion = () => { + setMobileAccordionState(prev => !prev) + } + return ( - + - + = ({ navLinks }) => { - + diff --git a/src/components/UI/docs/LinksList.tsx b/src/components/UI/docs/LinksList.tsx index e9b6f02653..a86af010b4 100644 --- a/src/components/UI/docs/LinksList.tsx +++ b/src/components/UI/docs/LinksList.tsx @@ -7,9 +7,10 @@ import { NavLink } from '../../../types'; interface LinksListProps { links: NavLink[]; + toggleMobileAccordion: () => void; } -export const LinksList: FC = ({ links }) => { +export const LinksList: FC = ({ links, toggleMobileAccordion }) => { const router = useRouter(); const { slug } = router.query; return ( @@ -25,7 +26,7 @@ export const LinksList: FC = ({ links }) => { data-group > - + = ({ links }) => { - {items && } + {items && } ) : ( {id} - {items && } + {items && } ); })}