feat: add hotel image
This commit is contained in:
@@ -19,6 +19,13 @@ export default function StayCard({ stay, lang }: StayCardProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<article className={styles.stay}>
|
<article className={styles.stay}>
|
||||||
|
<Image
|
||||||
|
className={styles.image}
|
||||||
|
alt={hotelInformation.hotelContent.images.metaData.altText}
|
||||||
|
src={hotelInformation.hotelContent.images.imageSizes.small}
|
||||||
|
width={420}
|
||||||
|
height={240}
|
||||||
|
/>
|
||||||
<footer className={styles.footer}>
|
<footer className={styles.footer}>
|
||||||
<Title
|
<Title
|
||||||
as="h5"
|
as="h5"
|
||||||
|
|||||||
@@ -6,6 +6,15 @@
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
flex-basis: 32rem;
|
flex-basis: 32rem;
|
||||||
height: 34rem;
|
height: 34rem;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
height: auto;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 22rem;
|
||||||
|
object-fit: cover;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export const getStaysSchema = z.object({
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
hotelName: z.string(),
|
hotelName: z.string(),
|
||||||
cityName: z.string(),
|
cityName: z.string().nullable(),
|
||||||
}),
|
}),
|
||||||
confirmationNumber: z.string(),
|
confirmationNumber: z.string(),
|
||||||
checkinDate: z.string(),
|
checkinDate: z.string(),
|
||||||
|
|||||||
@@ -80,10 +80,10 @@ export const userQueryRouter = router({
|
|||||||
stays: router({
|
stays: router({
|
||||||
previous: protectedProcedure.input(staysInput).query(async (opts) => {
|
previous: protectedProcedure.input(staysInput).query(async (opts) => {
|
||||||
try {
|
try {
|
||||||
const { limit: perPage, cursor } = opts.input
|
const { limit, cursor } = opts.input
|
||||||
|
|
||||||
const params = new URLSearchParams()
|
const params = new URLSearchParams()
|
||||||
params.set("limit", perPage.toString())
|
params.set("limit", limit.toString())
|
||||||
|
|
||||||
if (cursor) {
|
if (cursor) {
|
||||||
params.set("offset", cursor.toString())
|
params.set("offset", cursor.toString())
|
||||||
@@ -114,6 +114,7 @@ export const userQueryRouter = router({
|
|||||||
|
|
||||||
const apiJson = await apiResponse.json()
|
const apiJson = await apiResponse.json()
|
||||||
if (!apiJson.data?.length) {
|
if (!apiJson.data?.length) {
|
||||||
|
console.error(`Get Previous Stays - No data found from api call`)
|
||||||
throw internalServerError()
|
throw internalServerError()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,10 +144,10 @@ export const userQueryRouter = router({
|
|||||||
|
|
||||||
upcoming: protectedProcedure.input(staysInput).query(async (opts) => {
|
upcoming: protectedProcedure.input(staysInput).query(async (opts) => {
|
||||||
try {
|
try {
|
||||||
const { limit: perPage, cursor } = opts.input
|
const { limit, cursor } = opts.input
|
||||||
|
|
||||||
const params = new URLSearchParams()
|
const params = new URLSearchParams()
|
||||||
params.set("limit", perPage.toString())
|
params.set("limit", limit.toString())
|
||||||
|
|
||||||
if (cursor) {
|
if (cursor) {
|
||||||
params.set("offset", cursor.toString())
|
params.set("offset", cursor.toString())
|
||||||
@@ -177,6 +178,7 @@ export const userQueryRouter = router({
|
|||||||
|
|
||||||
const apiJson = await apiResponse.json()
|
const apiJson = await apiResponse.json()
|
||||||
if (!apiJson.data?.length) {
|
if (!apiJson.data?.length) {
|
||||||
|
console.error(`Get Upcoming Stays - No data found from api call`)
|
||||||
throw internalServerError()
|
throw internalServerError()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user