|
|
@ -51,8 +51,10 @@ export const DocsLinks: FC<Props> = ({ navLinks, toggleMobileAccordion }) => { |
|
|
|
{navLinks.map(({ id, to, items }, idx) => { |
|
|
|
{navLinks.map(({ id, to, items }, idx) => { |
|
|
|
const split = to?.split('/'); |
|
|
|
const split = to?.split('/'); |
|
|
|
const isActive = slug && split && split[split.length - 1] === slug[slug.length - 1]; |
|
|
|
const isActive = slug && split && split[split.length - 1] === slug[slug.length - 1]; |
|
|
|
|
|
|
|
const isSectionActive = openSections[id]; |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<Accordion key={id} index={openSections[id] ? 0 : -1} allowToggle mt='0 !important'> |
|
|
|
<Accordion key={id} index={isSectionActive ? 0 : -1} allowToggle mt='0 !important'> |
|
|
|
<AccordionItem border='none'> |
|
|
|
<AccordionItem border='none'> |
|
|
|
{({ isExpanded }) => ( |
|
|
|
{({ isExpanded }) => ( |
|
|
|
<> |
|
|
|
<> |
|
|
|