Function
ActivePageMarker
({
group,
pathname
}: {
group: NavigationItem;
pathname: string;
})
Source from the content-addressed store, hash-verified
| 61 | } |
| 62 | |
| 63 | function ActivePageMarker({ |
| 64 | group, |
| 65 | pathname |
| 66 | }: { |
| 67 | group: NavigationItem; |
| 68 | pathname: string; |
| 69 | }) { |
| 70 | let itemHeight = remToPx(2); |
| 71 | let offset = remToPx(0.25); |
| 72 | let activePageIndex = group.links.findIndex(link => link.href === pathname); |
| 73 | let top = offset + activePageIndex * itemHeight; |
| 74 | |
| 75 | return ( |
| 76 | <motion.div |
| 77 | layout |
| 78 | className="absolute left-2 h-6 w-px bg-zinc-800 dark:bg-white" |
| 79 | initial={{ opacity: 0 }} |
| 80 | animate={{ opacity: 1, transition: { delay: 0.2 } }} |
| 81 | exit={{ opacity: 0 }} |
| 82 | style={{ top }} |
| 83 | /> |
| 84 | ); |
| 85 | } |
| 86 | |
| 87 | function NavLink({ |
| 88 | href, |
Callers
nothing calls this directly
Tested by
no test coverage detected