feat(SW-1386): buttons can now correctly be links

This commit is contained in:
Christian Andolf
2025-01-28 14:35:50 +01:00
parent b0c24d8945
commit 07d222c355

View File

@@ -1,5 +1,6 @@
import Image from "@/components/Image" import Image from "@/components/Image"
import Button from "@/components/TempDesignSystem/Button" import Button from "@/components/TempDesignSystem/Button"
import Link from "@/components/TempDesignSystem/Link"
import BiroScript from "@/components/TempDesignSystem/Text/BiroScript" import BiroScript from "@/components/TempDesignSystem/Text/BiroScript"
import Body from "@/components/TempDesignSystem/Text/Body" import Body from "@/components/TempDesignSystem/Text/Body"
import Title from "@/components/TempDesignSystem/Text/Title" import Title from "@/components/TempDesignSystem/Text/Title"
@@ -40,13 +41,34 @@ export default function FullWidthCampaign({ content }: FullWidthCampaignProps) {
</Body> </Body>
<div className={styles.buttons}> <div className={styles.buttons}>
{node.has_primary_button ? ( {node.has_primary_button ? (
<Button intent="inverted" size="small" theme="base"> <Button intent="inverted" size="small" theme="base" asChild>
{node.primary_button.title} <Link
href={node.primary_button.href}
target={
node.primary_button.openInNewTab ? "_blank" : undefined
}
color="none"
>
{node.primary_button.title}
</Link>
</Button> </Button>
) : null} ) : null}
{node.has_secondary_button ? ( {node.has_secondary_button ? (
<Button intent="secondary" size="small" theme="primaryStrong"> <Button
{node.secondary_button.title} intent="secondary"
size="small"
theme="primaryStrong"
asChild
>
<Link
href={node.secondary_button.href}
target={
node.secondary_button.openInNewTab ? "_blank" : undefined
}
color="none"
>
{node.secondary_button.title}
</Link>
</Button> </Button>
) : null} ) : null}
</div> </div>