chore: extract to variable
This commit is contained in:
parent
df653f20e9
commit
5f8fc1c2e1
|
@ -51,8 +51,10 @@ export const DocsLinks: FC<Props> = ({ navLinks, toggleMobileAccordion }) => {
|
|||
{navLinks.map(({ id, to, items }, idx) => {
|
||||
const split = to?.split('/');
|
||||
const isActive = slug && split && split[split.length - 1] === slug[slug.length - 1];
|
||||
const isSectionActive = openSections[id];
|
||||
|
||||
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'>
|
||||
{({ isExpanded }) => (
|
||||
<>
|
||||
|
|
Loading…
Reference in New Issue