|
|
@ -7,9 +7,10 @@ import { NavLink } from '../../../types'; |
|
|
|
|
|
|
|
|
|
|
|
interface LinksListProps { |
|
|
|
interface LinksListProps { |
|
|
|
links: NavLink[]; |
|
|
|
links: NavLink[]; |
|
|
|
|
|
|
|
toggleMobileAccordion: () => void; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export const LinksList: FC<LinksListProps> = ({ links }) => { |
|
|
|
export const LinksList: FC<LinksListProps> = ({ links, toggleMobileAccordion }) => { |
|
|
|
const router = useRouter(); |
|
|
|
const router = useRouter(); |
|
|
|
const { slug } = router.query; |
|
|
|
const { slug } = router.query; |
|
|
|
return ( |
|
|
|
return ( |
|
|
@ -25,7 +26,7 @@ export const LinksList: FC<LinksListProps> = ({ links }) => { |
|
|
|
data-group |
|
|
|
data-group |
|
|
|
> |
|
|
|
> |
|
|
|
<NextLink href={to} passHref key={id} legacyBehavior> |
|
|
|
<NextLink href={to} passHref key={id} legacyBehavior> |
|
|
|
<Link textDecoration='none !important'> |
|
|
|
<Link textDecoration='none !important' onClick={toggleMobileAccordion}> |
|
|
|
<Text |
|
|
|
<Text |
|
|
|
textStyle='docs-nav-links' |
|
|
|
textStyle='docs-nav-links' |
|
|
|
color={items || isActive ? 'primary' : 'body'} |
|
|
|
color={items || isActive ? 'primary' : 'body'} |
|
|
@ -45,14 +46,14 @@ export const LinksList: FC<LinksListProps> = ({ links }) => { |
|
|
|
</Text> |
|
|
|
</Text> |
|
|
|
</Link> |
|
|
|
</Link> |
|
|
|
</NextLink> |
|
|
|
</NextLink> |
|
|
|
{items && <LinksList links={items} />} |
|
|
|
{items && <LinksList links={items} toggleMobileAccordion={toggleMobileAccordion}/>} |
|
|
|
</Stack> |
|
|
|
</Stack> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Stack key={id} pb={6}> |
|
|
|
<Stack key={id} pb={6}> |
|
|
|
<Text textStyle='docs-nav-links' color={items ? 'primary' : 'body'}> |
|
|
|
<Text textStyle='docs-nav-links' color={items ? 'primary' : 'body'}> |
|
|
|
{id} |
|
|
|
{id} |
|
|
|
</Text> |
|
|
|
</Text> |
|
|
|
{items && <LinksList links={items} />} |
|
|
|
{items && <LinksList links={items} toggleMobileAccordion={toggleMobileAccordion} />} |
|
|
|
</Stack> |
|
|
|
</Stack> |
|
|
|
); |
|
|
|
); |
|
|
|
})} |
|
|
|
})} |
|
|
|