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