Merged in feat/SW-1749-sidepeek-hotel-cta (pull request #2123)
feat(SW-1749): add link to hotel page in sidepeek * feat(SW-1749): add link to hotel page in sidepeek Approved-by: Matilda Landström
This commit is contained in:
@@ -68,14 +68,14 @@ export default function HotelReservationSidePeek() {
|
|||||||
<>
|
<>
|
||||||
<HotelSidePeek
|
<HotelSidePeek
|
||||||
additionalHotelData={hotelData.additionalData}
|
additionalHotelData={hotelData.additionalData}
|
||||||
hotel={hotelData.hotel}
|
hotel={{ ...hotelData.hotel, url: hotelData.url }}
|
||||||
restaurants={hotelData.restaurants}
|
restaurants={hotelData.restaurants}
|
||||||
activeSidePeek={activeSidePeek}
|
activeSidePeek={activeSidePeek}
|
||||||
close={handleCloseClick}
|
close={handleCloseClick}
|
||||||
showCTA={showCTA}
|
showCTA={showCTA}
|
||||||
/>
|
/>
|
||||||
<AmenitiesSidePeek
|
<AmenitiesSidePeek
|
||||||
hotel={hotelData.hotel}
|
hotel={{ ...hotelData.hotel, url: hotelData.url }}
|
||||||
restaurants={hotelData.restaurants}
|
restaurants={hotelData.restaurants}
|
||||||
additionalHotelData={hotelData.additionalData}
|
additionalHotelData={hotelData.additionalData}
|
||||||
activeSidePeek={activeSidePeek}
|
activeSidePeek={activeSidePeek}
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
.button {
|
||||||
|
margin-top: var(--Space-x2);
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
|
import ButtonLink from "@/components/ButtonLink"
|
||||||
import AdditionalAmenities from "@/components/SidePeeks/AmenitiesSidepeekContent/AdditionalAmenities"
|
import AdditionalAmenities from "@/components/SidePeeks/AmenitiesSidepeekContent/AdditionalAmenities"
|
||||||
import Accordion from "@/components/TempDesignSystem/Accordion"
|
import Accordion from "@/components/TempDesignSystem/Accordion"
|
||||||
import SidePeek from "@/components/TempDesignSystem/SidePeek"
|
import SidePeek from "@/components/TempDesignSystem/SidePeek"
|
||||||
@@ -11,6 +12,8 @@ import BreakfastAccordionItem from "../AmenitiesSidepeekContent/Accordions/Break
|
|||||||
import CheckInCheckOutAccordionItem from "../AmenitiesSidepeekContent/Accordions/CheckInCheckOut"
|
import CheckInCheckOutAccordionItem from "../AmenitiesSidepeekContent/Accordions/CheckInCheckOut"
|
||||||
import ParkingAccordionItem from "../AmenitiesSidepeekContent/Accordions/Parking"
|
import ParkingAccordionItem from "../AmenitiesSidepeekContent/Accordions/Parking"
|
||||||
|
|
||||||
|
import styles from "./amenitiesSidePeek.module.css"
|
||||||
|
|
||||||
import type { AmenitiesSidePeekProps } from "@/types/components/hotelReservation/amenitiesSidePeek"
|
import type { AmenitiesSidePeekProps } from "@/types/components/hotelReservation/amenitiesSidePeek"
|
||||||
import { SidePeekEnum } from "@/types/components/hotelReservation/sidePeek"
|
import { SidePeekEnum } from "@/types/components/hotelReservation/sidePeek"
|
||||||
|
|
||||||
@@ -44,6 +47,19 @@ export default function AmenitiesSidePeek({
|
|||||||
/>
|
/>
|
||||||
<AdditionalAmenities amenities={hotel.detailedFacilities} />
|
<AdditionalAmenities amenities={hotel.detailedFacilities} />
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
{hotel.url ? (
|
||||||
|
<ButtonLink
|
||||||
|
href={hotel.url}
|
||||||
|
variant="Secondary"
|
||||||
|
size="Medium"
|
||||||
|
typography="Body/Paragraph/mdBold"
|
||||||
|
className={styles.button}
|
||||||
|
>
|
||||||
|
{intl.formatMessage({
|
||||||
|
defaultMessage: "Read more about the hotel",
|
||||||
|
})}
|
||||||
|
</ButtonLink>
|
||||||
|
) : null}
|
||||||
</SidePeek>
|
</SidePeek>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { useIntl } from "react-intl"
|
|||||||
|
|
||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
|
import ButtonLink from "@/components/ButtonLink"
|
||||||
import Contact from "@/components/HotelReservation/Contact"
|
import Contact from "@/components/HotelReservation/Contact"
|
||||||
import AdditionalAmenities from "@/components/SidePeeks/AmenitiesSidepeekContent/AdditionalAmenities"
|
import AdditionalAmenities from "@/components/SidePeeks/AmenitiesSidepeekContent/AdditionalAmenities"
|
||||||
import Accordion from "@/components/TempDesignSystem/Accordion"
|
import Accordion from "@/components/TempDesignSystem/Accordion"
|
||||||
@@ -59,6 +60,18 @@ export default function HotelSidePeek({
|
|||||||
/>
|
/>
|
||||||
<AdditionalAmenities amenities={hotel.detailedFacilities} />
|
<AdditionalAmenities amenities={hotel.detailedFacilities} />
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
{hotel.url ? (
|
||||||
|
<ButtonLink
|
||||||
|
href={hotel.url}
|
||||||
|
variant="Secondary"
|
||||||
|
size="Medium"
|
||||||
|
typography="Body/Paragraph/mdBold"
|
||||||
|
>
|
||||||
|
{intl.formatMessage({
|
||||||
|
defaultMessage: "Read more about the hotel",
|
||||||
|
})}
|
||||||
|
</ButtonLink>
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</SidePeek>
|
</SidePeek>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -474,7 +474,20 @@ export const hotelQueryRouter = router({
|
|||||||
get: serviceProcedure
|
get: serviceProcedure
|
||||||
.input(hotelInputSchema)
|
.input(hotelInputSchema)
|
||||||
.query(async ({ ctx, input }) => {
|
.query(async ({ ctx, input }) => {
|
||||||
return getHotel(input, ctx.serviceToken)
|
const { hotelId, language } = input
|
||||||
|
|
||||||
|
const [hotelData, hotelPages] = await Promise.all([
|
||||||
|
getHotel(input, ctx.serviceToken),
|
||||||
|
getHotelPageUrls(language),
|
||||||
|
])
|
||||||
|
const hotelPage = hotelPages.find((page) => page.hotelId === hotelId)
|
||||||
|
|
||||||
|
return hotelData
|
||||||
|
? {
|
||||||
|
...hotelData,
|
||||||
|
url: hotelPage?.url ?? null,
|
||||||
|
}
|
||||||
|
: null
|
||||||
}),
|
}),
|
||||||
hotels: router({
|
hotels: router({
|
||||||
byCountry: router({
|
byCountry: router({
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import type { SidePeekEnum } from "@/types/components/hotelReservation/sidePeek"
|
|||||||
import type { AdditionalData, Hotel, Restaurant } from "@/types/hotel"
|
import type { AdditionalData, Hotel, Restaurant } from "@/types/hotel"
|
||||||
|
|
||||||
export type AmenitiesSidePeekProps = {
|
export type AmenitiesSidePeekProps = {
|
||||||
hotel: Hotel
|
hotel: Hotel & { url: string | null }
|
||||||
restaurants: Restaurant[]
|
restaurants: Restaurant[]
|
||||||
additionalHotelData: AdditionalData | undefined
|
additionalHotelData: AdditionalData | undefined
|
||||||
activeSidePeek: SidePeekEnum
|
activeSidePeek: SidePeekEnum
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import type { SidePeekEnum } from "@/types/components/hotelReservation/sidePeek"
|
|||||||
import type { AdditionalData, Hotel, Restaurant } from "@/types/hotel"
|
import type { AdditionalData, Hotel, Restaurant } from "@/types/hotel"
|
||||||
|
|
||||||
export type HotelSidePeekProps = {
|
export type HotelSidePeekProps = {
|
||||||
hotel: Hotel
|
hotel: Hotel & { url: string | null }
|
||||||
restaurants: Restaurant[]
|
restaurants: Restaurant[]
|
||||||
additionalHotelData: AdditionalData | undefined
|
additionalHotelData: AdditionalData | undefined
|
||||||
activeSidePeek: SidePeekEnum
|
activeSidePeek: SidePeekEnum
|
||||||
|
|||||||
Reference in New Issue
Block a user