Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/components/docs-breadcrumbs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,18 @@ export default function DocsBreadcrumbs({ routes }) {
const currentPath = router.pathname;
const breadcrumbLinks = generateBreadcrumbs(routes, currentPath);

if (breadcrumbLinks.length === 0 || currentPath === "/docs") {
if (breadcrumbLinks.length === 0) {
return;
}

const homeRoute = routes[0];
homeRoute.title = "Docs";
breadcrumbLinks.unshift(homeRoute);

if (currentPath === "/docs") {
breadcrumbLinks.shift(0);
}

return (
<div className="mt-4 mb-7 md:mt-2 md:mb-10">
<div className="flex flex-wrap items-center gap-2 text-sm">
Expand Down
2 changes: 1 addition & 1 deletion src/components/docs-layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default function DocumentPage({ children, metadata }) {
/>
</DisclosurePanel>
</Disclosure>
<main className="relative mx-auto flex max-w-full grid-cols-[1fr_auto_1fr] flex-col gap-6 overflow-scroll md:grid">
<main className="relative mx-auto flex max-w-full grid-cols-[1fr_auto_1fr] flex-col gap-6 md:grid">
<nav className="sticky top-[84px] hidden h-min w-60 overflow-y-auto p-6 md:block">
<DocsNav routes={routes} />
</nav>
Expand Down
4 changes: 1 addition & 3 deletions src/components/on-this-page-nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function OnThisPageNav({ children }) {
return (
<>
<h2 className="font-semibold">On This Page</h2>
{headings.length > 0 ? (
{headings.length > 0 && (
<ul className="mt-4 text-sm text-gray-400">
{headings.map((heading) => (
<li
Expand All @@ -68,8 +68,6 @@ export default function OnThisPageNav({ children }) {
</li>
))}
</ul>
) : (
<p>Loading...</p>
)}
</>
);
Expand Down
Loading