feat(SW-3354): Added possibility to add heading to top campaign on campaign overview page
Approved-by: Matilda Landström
This commit is contained in:
@@ -16,25 +16,28 @@ interface TopCampaignProps {
|
||||
export default async function TopCampaign({ topCampaign }: TopCampaignProps) {
|
||||
const lang = await getLang()
|
||||
const intl = await getIntl()
|
||||
const { campaign, heading } = topCampaign
|
||||
const buttonData = {
|
||||
cta: intl.formatMessage({ defaultMessage: "Explore the offer" }),
|
||||
url: `/${lang}${topCampaign.url}`,
|
||||
url: `/${lang}${campaign.url}`,
|
||||
}
|
||||
|
||||
return (
|
||||
<section className={styles.topCampaign}>
|
||||
<Typography variant="Title/md">
|
||||
<h2 className={styles.heading}>{topCampaign.heading}</h2>
|
||||
</Typography>
|
||||
<CampaignHero {...topCampaign.hero} button={buttonData} />
|
||||
{heading ? (
|
||||
<Typography variant="Title/md">
|
||||
<h2 className={styles.heading}>{heading}</h2>
|
||||
</Typography>
|
||||
) : null}
|
||||
<CampaignHero {...campaign.hero} button={buttonData} />
|
||||
<CampaignHotelListing
|
||||
heading={
|
||||
topCampaign.hotel_listing.heading ||
|
||||
campaign.hotel_listing.heading ||
|
||||
intl.formatMessage({
|
||||
defaultMessage: "Hotels included in this offer",
|
||||
})
|
||||
}
|
||||
hotelIds={topCampaign.hotel_listing.hotelIds}
|
||||
hotelIds={campaign.hotel_listing.hotelIds}
|
||||
visibleCountMobile={3}
|
||||
visibleCountDesktop={3}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user