Files
web/components/Blocks/FullWidthCampaign/index.tsx
Chuma Mcphoy (We Ahead) 341f0c54ed Merged in fix/SW-1733-start-page-enhancements-and-fixes (pull request #1415)
Fix/SW-1733 start page enhancements and fixes

* fix: simplify carousel navigation and grid layout styling and fix padding issue

* refactor(SW-1733): replace Preamble with Body component in JoinScandicFriends

* refactor(SW-1733): update FullWidthCampaign button width styling

* feat(SW-1733): Add gradient overlay to FullWidthCampaign component

* refactor(SW-1733): Simplify FullWidthCampaign button props

* refactor(SW-1733): Remove redundant button wrapper divs in FullWidthCampaign

* refactor(SW-1733): Adjust FullWidthCampaign button wrapper min-width responsively


Approved-by: Christian Andolf
2025-02-25 16:41:02 +00:00

92 lines
2.9 KiB
TypeScript

import Image from "@/components/Image"
import Button from "@/components/TempDesignSystem/Button"
import Link from "@/components/TempDesignSystem/Link"
import BiroScript from "@/components/TempDesignSystem/Text/BiroScript"
import Preamble from "@/components/TempDesignSystem/Text/Preamble"
import Title from "@/components/TempDesignSystem/Text/Title"
import styles from "./fullWidthCampaign.module.css"
import type { FullWidthCampaign } from "@/types/trpc/routers/contentstack/startPage"
interface FullWidthCampaignProps {
content: FullWidthCampaign
}
export default function FullWidthCampaign({ content }: FullWidthCampaignProps) {
const { background_image, primary_button, secondary_button } = content
return (
<div className={styles.container}>
{background_image ? (
<Image
className={styles.image}
alt={background_image.meta.alt || background_image.meta.caption || ""}
src={background_image.url}
focalPoint={background_image.focalPoint}
sizes="100vw"
fill
/>
) : null}
<div className={styles.content}>
<div className={styles.scriptedText}>
<BiroScript color="baseText" type="two" tilted="small">
{content.scripted_top_title}
</BiroScript>
</div>
<div className={styles.mainContent}>
<Title
color="baseText"
textAlign="center"
textTransform="capitalize"
level="h3"
>
{content.heading}
</Title>
<Preamble color="baseText" textAlign="center">
{content.body_text}
</Preamble>
<div className={styles.buttons}>
{content.has_primary_button ? (
<Button
intent="inverted"
size="small"
theme="base"
asChild
className={styles.buttonWrapper}
fullWidth
>
<Link
href={primary_button.href}
target={primary_button.openInNewTab ? "_blank" : undefined}
color="none"
>
{primary_button.title}
</Link>
</Button>
) : null}
{content.has_secondary_button ? (
<Button
intent="secondary"
size="small"
theme="primaryStrong"
className={styles.buttonWrapper}
asChild
fullWidth
>
<Link
href={secondary_button.href}
target={secondary_button.openInNewTab ? "_blank" : undefined}
color="none"
>
{secondary_button.title}
</Link>
</Button>
) : null}
</div>
</div>
</div>
</div>
)
}