diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Stays/StayCard/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Stays/StayCard/index.tsx index c496813e9..ba5387da4 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/Stays/StayCard/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/Stays/StayCard/index.tsx @@ -18,13 +18,37 @@ import styles from "./stay.module.css" import type { StayCardProps } from "@/types/components/myPages/stays/stayCard" export default function StayCard({ stay }: StayCardProps) { - const lang = useLang() - // TODO: Temporary loading. Remove when current web is deleted. const [loading, setLoading] = useState(false) - const { checkinDate, checkoutDate, hotelInformation, bookingUrl } = - stay.attributes + const { bookingUrl, isWebAppOrigin } = stay.attributes + + const shouldLinkToMyStay = isWebAppOrigin + + if (!shouldLinkToMyStay) { + return + } + + return ( + setLoading(true)} + > + + {loading && ( +
+ +
+ )} + + ) +} + +function CardContent({ stay }: StayCardProps) { + const lang = useLang() + + const { checkinDate, checkoutDate, hotelInformation } = stay.attributes const arrival = dt(checkinDate).locale(lang) const arrivalDate = arrival.format("DD MMM") @@ -34,44 +58,33 @@ export default function StayCard({ stay }: StayCardProps) { const departDateTime = depart.format("YYYY-MM-DD") return ( - setLoading(true)} - > -
- {hotelInformation.hotelContent.images.metaData.altText} -
- - {hotelInformation.hotelName} - -
- - - - - {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} - {" - "} - - - -
-
-
- {loading && ( -
- +
+ {hotelInformation.hotelContent.images.metaData.altText} + +
) }