Skip to content

Commit

Permalink
Update SectionTitle.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
pogseal committed Sep 3, 2024
1 parent 203d5a2 commit 7a5112f
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import type { Flatten } from "./Section";

export function SectionTitle({
section,
customTitle,
}: {
section: Flatten<Collection["sections"]>;
section?: Flatten<Collection["sections"]>;
customTitle?: string;
}) {
const hasTitle = section?.showTitle && section.name;

if (hasTitle)
if (hasTitle || customTitle)
return (
<div className="max-w-[728px] mx-auto">
<Link to={`#${section?.slug}`}>
Expand All @@ -27,7 +29,7 @@ export function SectionTitle({
/>
<div className="flex items-center gap-2">
<div className="relative h-full px-3.5 flex-grow py-2.5">
{section?.name}
{customTitle ?? section?.name}
</div>
</div>
</h2>
Expand Down

0 comments on commit 7a5112f

Please sign in to comment.