feat(SW-2973): Added bookingCode if available to links inside campaign pages
* feat(SW-2973): Moved block types to trpc lib Approved-by: Matilda Landström
This commit is contained in:
@@ -24,6 +24,7 @@ import styles from "./campaignHotelListing.module.css"
|
||||
interface CampaignHotelListingClientProps {
|
||||
heading: string
|
||||
preamble?: string | null
|
||||
bookingCode?: string | null
|
||||
visibleCountMobile: 3 | 6
|
||||
visibleCountDesktop: 3 | 6
|
||||
isMainBlock: boolean
|
||||
@@ -35,6 +36,7 @@ export default function CampaignHotelListingClient({
|
||||
visibleCountMobile,
|
||||
visibleCountDesktop,
|
||||
isMainBlock,
|
||||
bookingCode,
|
||||
}: CampaignHotelListingClientProps) {
|
||||
const intl = useIntl()
|
||||
const isMobile = useMediaQuery("(max-width: 767px)")
|
||||
@@ -119,16 +121,24 @@ export default function CampaignHotelListingClient({
|
||||
) : null}
|
||||
</header>
|
||||
<ul className={styles.list}>
|
||||
{activeHotels.map(({ hotel, url }, index) => (
|
||||
<li
|
||||
key={hotel.id}
|
||||
className={cx(styles.listItem, {
|
||||
[styles.hidden]: index >= visibleCount,
|
||||
})}
|
||||
>
|
||||
<HotelListingItem hotel={hotel} url={url} />
|
||||
</li>
|
||||
))}
|
||||
{activeHotels.map(({ hotel, url }, index) => {
|
||||
const urlWithOptionalBookingCode = bookingCode
|
||||
? `${url}?bookingCode=${bookingCode}`
|
||||
: url
|
||||
return (
|
||||
<li
|
||||
key={hotel.id}
|
||||
className={cx(styles.listItem, {
|
||||
[styles.hidden]: index >= visibleCount,
|
||||
})}
|
||||
>
|
||||
<HotelListingItem
|
||||
hotel={hotel}
|
||||
url={urlWithOptionalBookingCode}
|
||||
/>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
|
||||
{showButton ? (
|
||||
|
||||
Reference in New Issue
Block a user