feat: add links to entire article header
This commit is contained in:
@ -47,29 +47,25 @@ function Title(
|
||||
{ children, link }: { children: ComponentChildren; link?: string },
|
||||
) {
|
||||
const ctx = useContext(HeroContext);
|
||||
|
||||
const OuterTag = link ? "a" : "div";
|
||||
|
||||
return (
|
||||
<div
|
||||
<OuterTag
|
||||
href={link}
|
||||
class={`${
|
||||
ctx.image ? "noisy-gradient" : ""
|
||||
} after:opacity-90 flex gap-4 items-center ${ctx.image ? "pt-12" : ""}`}
|
||||
>
|
||||
<h2
|
||||
class="relative text-4xl font-bold z-10"
|
||||
class="flex gap-2 items-center text-4xl font-bold z-10"
|
||||
style={{ color: ctx.image ? "#1F1F1F" : "white" }}
|
||||
>
|
||||
{children}
|
||||
{link &&
|
||||
(
|
||||
<a
|
||||
href={link}
|
||||
target="__blank"
|
||||
class="p-2 inline-flex"
|
||||
>
|
||||
<IconExternalLink />
|
||||
</a>
|
||||
)}
|
||||
<IconExternalLink />}
|
||||
</h2>
|
||||
</div>
|
||||
</OuterTag>
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user