Merge pull request 'fix/nav' (#3) from fix/nav into main
All checks were successful
Update Memento Dev on VPS / deploy (push) Successful in 3m44s
All checks were successful
Update Memento Dev on VPS / deploy (push) Successful in 3m44s
Reviewed-on: #3
This commit is contained in:
commit
d338a674e2
@ -40,9 +40,9 @@ function PageLink({
|
|||||||
>
|
>
|
||||||
<p className="flex flex-col gap-0">
|
<p className="flex flex-col gap-0">
|
||||||
{pageCategory && (
|
{pageCategory && (
|
||||||
<span className="text-violet-600 dark:text-violet-400 text-sm -mb-3">{pageCategory.title}</span>
|
<span className="text-violet-600 dark:text-violet-400 text-sm mb-1 leading-3">{pageCategory.title}</span>
|
||||||
)}
|
)}
|
||||||
<span>{title}</span>
|
<span className="leading-4">{title}</span>
|
||||||
</p>
|
</p>
|
||||||
<ArrowIcon className={clsx("h-6 w-6 flex-none fill-current", dir === "previous" && "-scale-x-100")} />
|
<ArrowIcon className={clsx("h-6 w-6 flex-none fill-current", dir === "previous" && "-scale-x-100")} />
|
||||||
</Link>
|
</Link>
|
||||||
@ -65,7 +65,13 @@ export function PrevNextLinks() {
|
|||||||
if (linkIndex === -1) return [null, null];
|
if (linkIndex === -1) return [null, null];
|
||||||
|
|
||||||
const previousPage = allLinks[linkIndex - 1] || null;
|
const previousPage = allLinks[linkIndex - 1] || null;
|
||||||
const nextPage = allLinks[linkIndex + 1] || null;
|
let nextPage = allLinks[linkIndex + 1] || null;
|
||||||
|
|
||||||
|
// In case the next page is the same as the current page (in subitems),
|
||||||
|
// we need to skip it to get the correct next page.
|
||||||
|
if (nextPage.href === urlPathname) {
|
||||||
|
nextPage = allLinks[linkIndex + 2] || null;
|
||||||
|
}
|
||||||
|
|
||||||
return [previousPage, nextPage];
|
return [previousPage, nextPage];
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user