feat: schema change
This commit is contained in:
@@ -13,7 +13,13 @@ export default async function HotelCard({ hotel }: HotelCardProps) {
|
||||
const { formatMessage } = await getIntl()
|
||||
return (
|
||||
<article className={styles.card}>
|
||||
<Image src="" alt="hotel image" className={styles.image} />
|
||||
<Image
|
||||
src={hotel.hotelContent.images.imageSizes.large}
|
||||
alt={hotel.hotelContent.images.metaData.altText}
|
||||
width={300}
|
||||
height={200}
|
||||
className={styles.image}
|
||||
/>
|
||||
<div className={styles.information}>
|
||||
<header className={styles.title}>
|
||||
<ScandicLogoIcon color="red" />
|
||||
|
||||
@@ -11,8 +11,8 @@ export default async function HotelFilter({ filters }: HotelFilterProps) {
|
||||
<aside className={styles.container}>
|
||||
<div className={styles.facilities}>
|
||||
{formatMessage({ id: "Room facilities" })}
|
||||
{filters.filterType.roomFacilities.map((roomFilter, index) => (
|
||||
<div key={index} className={styles.filter}>
|
||||
{filters.roomFacilities.map((roomFilter, index) => (
|
||||
<div key={`room filter-${index}`} className={styles.filter}>
|
||||
<input id={roomFilter} name={roomFilter} type="checkbox" />
|
||||
<label htmlFor={roomFilter}>{roomFilter}</label>
|
||||
</div>
|
||||
@@ -20,8 +20,8 @@ export default async function HotelFilter({ filters }: HotelFilterProps) {
|
||||
</div>
|
||||
<div className={styles.facilities}>
|
||||
{formatMessage({ id: "Hotel facilities" })}
|
||||
{filters.filterType.hotelFacilities.map((hotelFilter, index) => (
|
||||
<div key={index} className={styles.filter}>
|
||||
{filters.hotelFacilities.map((hotelFilter, index) => (
|
||||
<div key={`hotel filter-${index}`} className={styles.filter}>
|
||||
<input id={hotelFilter} name={hotelFilter} type="checkbox" />
|
||||
<label htmlFor={hotelFilter}>{hotelFilter}</label>
|
||||
</div>
|
||||
@@ -29,10 +29,10 @@ export default async function HotelFilter({ filters }: HotelFilterProps) {
|
||||
</div>
|
||||
<div className={styles.facilities}>
|
||||
{formatMessage({ id: "Hotel surroundings" })}
|
||||
{filters.filterType.hotelSurroundings.map((sorroundings, index) => (
|
||||
<div key={index} className={styles.filter}>
|
||||
<input id={sorroundings} name={sorroundings} type="checkbox" />
|
||||
<label htmlFor={sorroundings}>{sorroundings}</label>
|
||||
{filters.hotelSurroundings.map((surroundings, index) => (
|
||||
<div key={`surroundings filter-${index}`} className={styles.filter}>
|
||||
<input id={surroundings} name={surroundings} type="checkbox" />
|
||||
<label htmlFor={surroundings}>{surroundings}</label>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -483,11 +483,9 @@ export const getRatesSchema = z.array(rate)
|
||||
export type Rate = z.infer<typeof rate>
|
||||
|
||||
const hotelFilter = z.object({
|
||||
filterType: z.object({
|
||||
roomFacilities: z.array(z.string()),
|
||||
hotelFacilities: z.array(z.string()),
|
||||
hotelSurroundings: z.array(z.string()),
|
||||
}),
|
||||
roomFacilities: z.array(z.string()),
|
||||
hotelFacilities: z.array(z.string()),
|
||||
hotelSurroundings: z.array(z.string()),
|
||||
})
|
||||
|
||||
export const getFiltersSchema = hotelFilter
|
||||
|
||||
@@ -1,24 +1,22 @@
|
||||
{
|
||||
"filterType": {
|
||||
"roomFacilities": ["Balcony", "Bathub", "View", "Conntecting doors"],
|
||||
"hotelFacilities": [
|
||||
"Parking inside",
|
||||
"Parking outside",
|
||||
"Parking electric",
|
||||
"Sauna",
|
||||
"Pool",
|
||||
"Restaurant",
|
||||
"Bar",
|
||||
"Sky/rooftop bar",
|
||||
"Gym",
|
||||
"Coworking"
|
||||
],
|
||||
"hotelSurroundings": [
|
||||
"Beach",
|
||||
"Lake or sea",
|
||||
"Hiking",
|
||||
"Mountains",
|
||||
"Golf course"
|
||||
]
|
||||
}
|
||||
"roomFacilities": ["Balcony", "Bathub", "View", "Conntecting doors"],
|
||||
"hotelFacilities": [
|
||||
"Parking inside",
|
||||
"Parking outside",
|
||||
"Parking electric",
|
||||
"Sauna",
|
||||
"Pool",
|
||||
"Restaurant",
|
||||
"Bar",
|
||||
"Sky/rooftop bar",
|
||||
"Gym",
|
||||
"Coworking"
|
||||
],
|
||||
"hotelSurroundings": [
|
||||
"Beach",
|
||||
"Lake or sea",
|
||||
"Hiking",
|
||||
"Mountains",
|
||||
"Golf course"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user