mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-18 08:26:35 +00:00
Merge pull request #49 from netbirdio/feature/fix_dropdowns
This commit is contained in:
@@ -138,7 +138,7 @@ function NavigationGroup({ group, className, tableOfContents }) {
|
|||||||
let router = useRouter()
|
let router = useRouter()
|
||||||
|
|
||||||
let isActiveGroup =
|
let isActiveGroup =
|
||||||
group.links.findIndex((link) => link.href === router.pathname) !== -1
|
group.links.findIndex((link) => link.href === router.pathname.replace("ipa", "api")) !== -1
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li className={clsx('relative mt-6', className)}>
|
<li className={clsx('relative mt-6', className)}>
|
||||||
@@ -151,7 +151,7 @@ function NavigationGroup({ group, className, tableOfContents }) {
|
|||||||
<div className="relative mt-3 pl-2">
|
<div className="relative mt-3 pl-2">
|
||||||
<AnimatePresence >
|
<AnimatePresence >
|
||||||
{isActiveGroup && (
|
{isActiveGroup && (
|
||||||
<VisibleSectionHighlight group={group} pathname={router.pathname} />
|
<VisibleSectionHighlight group={group} pathname={router.pathname.replace("ipa", "api")} />
|
||||||
)}
|
)}
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
<motion.div
|
<motion.div
|
||||||
@@ -160,17 +160,17 @@ function NavigationGroup({ group, className, tableOfContents }) {
|
|||||||
/>
|
/>
|
||||||
<AnimatePresence initial={false}>
|
<AnimatePresence initial={false}>
|
||||||
{isActiveGroup && (
|
{isActiveGroup && (
|
||||||
<ActivePageMarker group={group} pathname={router.pathname} />
|
<ActivePageMarker group={group} pathname={router.pathname.replace("ipa", "api")} />
|
||||||
)}
|
)}
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
<ul role="list" className="border-l border-transparent">
|
<ul role="list" className="border-l border-transparent">
|
||||||
{group.links.map((link) => (
|
{group.links.map((link) => (
|
||||||
<motion.li key={link.href} layout="position" className="relative">
|
<motion.li key={link.href} layout="position" className="relative">
|
||||||
<NavLink href={link.href} active={link.href === router.pathname}>
|
<NavLink href={link.href} active={link.href === router.pathname.replace("ipa", "api")}>
|
||||||
{link.title}
|
{link.title}
|
||||||
</NavLink>
|
</NavLink>
|
||||||
<AnimatePresence mode="popLayout" initial={false}>
|
<AnimatePresence mode="popLayout" initial={false}>
|
||||||
{link.href === router.pathname && (
|
{link.href === router.pathname.replace("ipa", "api") && (
|
||||||
<motion.ul
|
<motion.ul
|
||||||
role="list"
|
role="list"
|
||||||
initial={{ opacity: 0 }}
|
initial={{ opacity: 0 }}
|
||||||
|
|||||||
Reference in New Issue
Block a user