fi(SW-188): implement PR feedback

This commit is contained in:
Chuma McPhoy
2024-08-20 17:23:23 +02:00
parent f3d32033a5
commit f4586ba35b
6 changed files with 23 additions and 19 deletions

View File

@@ -30,8 +30,11 @@ export default async function IntroSection({
) )
const lang = getLang() const lang = getLang()
const formattedLocationText = `${streetAddress}, ${city} (${formattedDistanceText})` const formattedLocationText = `${streetAddress}, ${city} (${formattedDistanceText})`
const hasTripAdvisorData = const hasTripAdvisorData = !!(
tripAdvisor?.rating && tripAdvisor?.numberOfReviews && tripAdvisor?.webUrl tripAdvisor?.rating &&
tripAdvisor?.numberOfReviews &&
tripAdvisor?.webUrl
)
const formattedTripAdvisorText = hasTripAdvisorData const formattedTripAdvisorText = hasTripAdvisorData
? intl.formatMessage( ? intl.formatMessage(
{ id: "Tripadvisor reviews" }, { id: "Tripadvisor reviews" },

View File

@@ -35,11 +35,11 @@ export function RoomCard({
return ( return (
<article className={styles.roomCard}> <article className={styles.roomCard}>
<button className={styles.imageWrapper} onClick={handleImageClick}> <button className={styles.imageWrapper} onClick={handleImageClick}>
{badgeTextTransKey && ( {/* {badgeTextTransKey && ( */}
<span className={styles.badge}> {/* <span className={styles.badge}> */}
{intl.formatMessage({ id: badgeTextTransKey })} {/* {intl.formatMessage({ id: badgeTextTransKey })} */}
</span> {/* </span> */}
)} {/* )} */}
<span className={styles.imageCount}> <span className={styles.imageCount}>
<ImageIcon color="white" /> <ImageIcon color="white" />
{images.length} {images.length}
@@ -67,9 +67,7 @@ export function RoomCard({
variant="underscored" variant="underscored"
onClick={handleRoomCtaClick} onClick={handleRoomCtaClick}
> >
{intl.formatMessage({ {intl.formatMessage({ id: "See room details" })}
id: "hotelPages.rooms.roomCard.seeRoomDetails",
})}
</Link> </Link>
</div> </div>
</article> </article>

View File

@@ -105,6 +105,7 @@
"Retype new password": "Retype new password", "Retype new password": "Retype new password",
"Rooms": "Rooms", "Rooms": "Rooms",
"Save": "Save", "Save": "Save",
"See room details": "See room details",
"Select a country": "Select a country", "Select a country": "Select a country",
"Select country of residence": "Select country of residence", "Select country of residence": "Select country of residence",
"Select date of birth": "Select date of birth", "Select date of birth": "Select date of birth",

View File

@@ -54,7 +54,7 @@
"How it works": "Hur det fungerar", "How it works": "Hur det fungerar",
"hotelPages.rooms.roomCard.person": "person", "hotelPages.rooms.roomCard.person": "person",
"hotelPages.rooms.roomCard.persons": "personer", "hotelPages.rooms.roomCard.persons": "personer",
"hotelPages.rooms.roomCard.seeRoomDetails": "Se rumsdetaljer", "See room details": "Se rumsdetaljer",
"Join Scandic Friends": "Gå med i Scandic Friends", "Join Scandic Friends": "Gå med i Scandic Friends",
"Language": "Språk", "Language": "Språk",
"Level": "Nivå", "Level": "Nivå",

View File

@@ -7,7 +7,7 @@ import type {
RequestOptionsWithJSONBody, RequestOptionsWithJSONBody,
RequestOptionsWithOutBody, RequestOptionsWithOutBody,
} from "@/types/fetch" } from "@/types/fetch"
import type { Endpoint } from "./endpoints" import type { Endpoint, endpoints } from "./endpoints"
export { endpoints } from "./endpoints" export { endpoints } from "./endpoints"
@@ -27,7 +27,7 @@ const fetch = fetchRetry(global.fetch, {
}) })
export async function get( export async function get(
endpoint: Endpoint | `${Endpoint}/${string}`, endpoint: Endpoint | `${endpoints.v1.hotels}/${string}`,
options: RequestOptionsWithOutBody, options: RequestOptionsWithOutBody,
params?: URLSearchParams params?: URLSearchParams
) { ) {

View File

@@ -19,11 +19,13 @@ const ratingsSchema = z
}), }),
}) })
), ),
reviews: z.object({ reviews: z
widgetHtmlTagId: z.string(), .object({
widgetScriptEmbedUrlIframe: z.string(), widgetHtmlTagId: z.string(),
widgetScriptEmbedUrlJavaScript: z.string(), widgetScriptEmbedUrlIframe: z.string(),
}), widgetScriptEmbedUrlJavaScript: z.string(),
})
.optional(),
}), }),
}) })
.optional() .optional()
@@ -153,7 +155,7 @@ const detailedFacilitySchema = z.object({
code: z.string().optional(), code: z.string().optional(),
applyToAllHotels: z.boolean(), applyToAllHotels: z.boolean(),
public: z.boolean(), public: z.boolean(),
icon: z.string(), //Check output. icon: z.string(),
iconName: z.string().optional(), iconName: z.string().optional(),
sortOrder: z.number(), sortOrder: z.number(),
}) })