From c71c8af35af4b57b6f91984eb0669e363532c78b Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Wed, 20 Nov 2024 14:32:33 +0100 Subject: [PATCH 1/5] feat(SW-938) Added icon to roomFacilitiesSchema and detailedFacilitySchema --- .../HotelSidePeek/hotelSidePeek.module.css | 10 +++++-- components/SidePeeks/HotelSidePeek/index.tsx | 26 +++++++++++++++---- components/SidePeeks/RoomSidePeek/index.tsx | 10 +++++-- .../AccordionItem/accordionItem.module.css | 2 +- server/routers/hotels/output.ts | 1 + server/routers/hotels/schemas/room.ts | 1 + .../selectHotel/hotelFilters.ts | 1 + 7 files changed, 41 insertions(+), 10 deletions(-) diff --git a/components/SidePeeks/HotelSidePeek/hotelSidePeek.module.css b/components/SidePeeks/HotelSidePeek/hotelSidePeek.module.css index 57bb78db4..37fb3aeab 100644 --- a/components/SidePeeks/HotelSidePeek/hotelSidePeek.module.css +++ b/components/SidePeeks/HotelSidePeek/hotelSidePeek.module.css @@ -13,8 +13,14 @@ font-family: var(--typography-Body-Regular-fontFamily); border-bottom: 1px solid var(--Base-Border-Subtle); /* padding set to align with AccordionItem which has a different composition */ - padding: var(--Spacing-x2) - calc(var(--Spacing-x1) + var(--Spacing-x-one-and-half)); + padding: calc(var(--Spacing-x1) + var(--Spacing-x-one-and-half)) + var(--Spacing-x3); + display: flex; + gap: var(--Spacing-x1); +} + +.noIcon { + margin-left: var(--Spacing-x4); } .list { diff --git a/components/SidePeeks/HotelSidePeek/index.tsx b/components/SidePeeks/HotelSidePeek/index.tsx index 06ac3e5f2..259c8d16c 100644 --- a/components/SidePeeks/HotelSidePeek/index.tsx +++ b/components/SidePeeks/HotelSidePeek/index.tsx @@ -8,12 +8,15 @@ import SidePeek from "@/components/TempDesignSystem/SidePeek" import Body from "@/components/TempDesignSystem/Text/Body" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" +import { getFacilityIcon } from "../RoomSidePeek/facilityIcon" + import styles from "./hotelSidePeek.module.css" -import { HotelSidePeekProps } from "@/types/components/hotelReservation/hotelSidePeek" -import { ParkingProps } from "@/types/components/hotelReservation/selectHotel/selectHotel" +import type { HotelSidePeekProps } from "@/types/components/hotelReservation/hotelSidePeek" +import type { ParkingProps } from "@/types/components/hotelReservation/selectHotel/selectHotel" import { SidePeekEnum } from "@/types/components/hotelReservation/sidePeek" -import { Amenities, Hotel } from "@/types/hotel" +import { IconName } from "@/types/components/icon" +import type { Amenities, Hotel } from "@/types/hotel" function getAmenitiesList(hotel: Hotel) { const detailedAmenities: Amenities = hotel.detailedFacilities.filter( @@ -46,7 +49,10 @@ export default function HotelSidePeek({ {/* parking */} {hotel.parking.length ? ( - + {hotel.parking.map((p) => ( ))} @@ -56,9 +62,19 @@ export default function HotelSidePeek({ {intl.formatMessage({ id: "Accessibility" })} {amenitiesList.map((amenity) => { + const Icon = getFacilityIcon(amenity.icon) return (
- {amenity.name} + {Icon && ( + + )} + + {amenity.name} +
) })} diff --git a/components/SidePeeks/RoomSidePeek/index.tsx b/components/SidePeeks/RoomSidePeek/index.tsx index da46a6f42..175eb14a0 100644 --- a/components/SidePeeks/RoomSidePeek/index.tsx +++ b/components/SidePeeks/RoomSidePeek/index.tsx @@ -56,10 +56,16 @@ export default function RoomSidePeek({ {room.roomFacilities .sort((a, b) => a.sortOrder - b.sortOrder) .map((facility) => { - const Icon = getFacilityIcon(facility.name) + const Icon = getFacilityIcon(facility.icon) return (
  • - {Icon && } + {Icon && ( + + )} Date: Thu, 21 Nov 2024 09:37:38 +0100 Subject: [PATCH 2/5] feat(SW-938) Updated icons --- components/ContentType/HotelPage/data.ts | 4 +- .../HotelCardDialogListing/utils.ts | 7 +- components/Icons/Bike.tsx | 23 +++ components/Icons/Restaurant.tsx | 2 +- components/Icons/Store.tsx | 23 +++ components/Icons/index.tsx | 2 + .../HotelSidePeek/hotelFacilityIcon.ts | 157 ++++++++++++++++++ components/SidePeeks/HotelSidePeek/index.tsx | 10 +- .../SidePeeks/RoomSidePeek/facilityIcon.ts | 55 +++--- server/routers/hotels/output.ts | 2 +- server/routers/hotels/schemas/room.ts | 2 +- 11 files changed, 253 insertions(+), 34 deletions(-) create mode 100644 components/Icons/Bike.tsx create mode 100644 components/Icons/Store.tsx create mode 100644 components/SidePeeks/HotelSidePeek/hotelFacilityIcon.ts diff --git a/components/ContentType/HotelPage/data.ts b/components/ContentType/HotelPage/data.ts index e4043c53e..dd2a74f90 100644 --- a/components/ContentType/HotelPage/data.ts +++ b/components/ContentType/HotelPage/data.ts @@ -14,8 +14,8 @@ const facilityToIconMap: Record = { [FacilityEnum.GymTrainingFacilities]: IconName.Fitness, [FacilityEnum.KeyAccessOnlyToHealthClubGym]: IconName.Fitness, [FacilityEnum.FreeWiFi]: IconName.Wifi, - [FacilityEnum.MeetingRooms]: IconName.People2, - [FacilityEnum.MeetingConferenceFacilities]: IconName.People2, + [FacilityEnum.MeetingRooms]: IconName.Business, + [FacilityEnum.MeetingConferenceFacilities]: IconName.Business, [FacilityEnum.PetFriendlyRooms]: IconName.Pets, [FacilityEnum.Sauna]: IconName.Sauna, [FacilityEnum.Restaurant]: IconName.Restaurant, diff --git a/components/HotelReservation/HotelCardDialogListing/utils.ts b/components/HotelReservation/HotelCardDialogListing/utils.ts index ba40ccc3a..2299b3f35 100644 --- a/components/HotelReservation/HotelCardDialogListing/utils.ts +++ b/components/HotelReservation/HotelCardDialogListing/utils.ts @@ -15,7 +15,12 @@ export function getHotelPins(hotels: HotelData[]): HotelPin[] { hotel.hotelData.hotelContent.images, ...(hotel.hotelData.gallery?.heroImages ?? []), ], - amenities: hotel.hotelData.detailedFacilities.slice(0, 3), + amenities: hotel.hotelData.detailedFacilities + .map((facility) => ({ + ...facility, + icon: facility.icon ?? "None", + })) + .slice(0, 3), ratings: hotel.hotelData.ratings?.tripAdvisor.rating ?? null, operaId: hotel.hotelData.operaId, })) diff --git a/components/Icons/Bike.tsx b/components/Icons/Bike.tsx new file mode 100644 index 000000000..131d91a99 --- /dev/null +++ b/components/Icons/Bike.tsx @@ -0,0 +1,23 @@ +import { iconVariants } from "./variants" + +import type { IconProps } from "@/types/components/icon" + +export default function BikeIcon({ className, color, ...props }: IconProps) { + const classNames = iconVariants({ className, color }) + return ( + + + + ) +} diff --git a/components/Icons/Restaurant.tsx b/components/Icons/Restaurant.tsx index 8fe36e0e6..adeea74a1 100644 --- a/components/Icons/Restaurant.tsx +++ b/components/Icons/Restaurant.tsx @@ -19,7 +19,7 @@ export default function RestaurantIcon({ {...props} > diff --git a/components/Icons/Store.tsx b/components/Icons/Store.tsx new file mode 100644 index 000000000..925b908eb --- /dev/null +++ b/components/Icons/Store.tsx @@ -0,0 +1,23 @@ +import { iconVariants } from "./variants" + +import type { IconProps } from "@/types/components/icon" + +export default function StoreIcon({ className, color, ...props }: IconProps) { + const classNames = iconVariants({ className, color }) + return ( + + + + ) +} diff --git a/components/Icons/index.tsx b/components/Icons/index.tsx index d252c8755..26ca0d7ba 100644 --- a/components/Icons/index.tsx +++ b/components/Icons/index.tsx @@ -11,6 +11,7 @@ export { default as BarIcon } from "./Bar" export { default as BathtubIcon } from "./Bathtub" export { default as BedDoubleIcon } from "./BedDouble" export { default as BedSingleIcon } from "./BedSingle" +export { default as BikeIcon } from "./Bike" export { default as BikingIcon } from "./Biking" export { default as BreakfastIcon } from "./Breakfast" export { default as BusinessIcon } from "./Business" @@ -124,6 +125,7 @@ export { default as SmokingIcon } from "./Smoking" export { default as SnowflakeIcon } from "./Snowflake" export { default as SpaIcon } from "./Spa" export { default as StarFilledIcon } from "./StarFilled" +export { default as StoreIcon } from "./Store" export { default as StreetIcon } from "./Street" export { default as SwimIcon } from "./Swim" export { default as ThermostatIcon } from "./Thermostat" diff --git a/components/SidePeeks/HotelSidePeek/hotelFacilityIcon.ts b/components/SidePeeks/HotelSidePeek/hotelFacilityIcon.ts new file mode 100644 index 000000000..3bf8fc496 --- /dev/null +++ b/components/SidePeeks/HotelSidePeek/hotelFacilityIcon.ts @@ -0,0 +1,157 @@ +import { FC } from "react" + +import { + AcIcon, + BarIcon, + BathtubIcon, + BedDoubleIcon, + BikeIcon, + BikingIcon, + BreakfastIcon, + BusinessIcon, + ChairIcon, + CityIcon, + CoffeeIcon, + ConciergeIcon, + DeskIcon, + ElectricBikeIcon, + ElectricCarIcon, + FitnessIcon, + GarageIcon, + HairdryerIcon, + HandSoapIcon, + HeartIcon, + IronIcon, + KayakingIcon, + LaundryMachineIcon, + LocalBarIcon, + MirrorIcon, + NatureIcon, + NightlifeIcon, + NoSmokingIcon, + OutdoorFurnitureIcon, + ParkingIcon, + RestaurantIcon, + RoomServiceIcon, + SafetyBoxIcon, + SaunaIcon, + ShoppingIcon, + ShowerIcon, + SkateboardingIcon, + StarFilledIcon, + StoreIcon, + StreetIcon, + SwimIcon, + WifiIcon, + WindowCurtainsAltIcon, + WindowNotAvailableIcon, + WineBarIcon, + WoodFloorIcon, + YardIcon, +} from "@/components/Icons" + +import { IconProps } from "@/types/components/icon" + +export function getHotelFacilityIcon( + name: string | undefined +): FC | null { + if (!name) return StarFilledIcon + + const iconMappings = [ + { + icon: FitnessIcon, + name: ["Gym"], + }, + { + icon: SwimIcon, + name: ["Pool"], + }, + { + icon: WifiIcon, + name: ["FreeWiFi"], + }, + { + icon: LaundryMachineIcon, + name: ["LaundryService"], + }, + { + icon: LaundryMachineIcon, + name: ["ExpressLaundryService"], + }, + { + icon: ParkingIcon, + name: ["Parking"], + }, + { + icon: GarageIcon, + name: ["Garage"], + }, + { + icon: BikeIcon, + name: ["BikesForLoan"], + }, + { + icon: ElectricCarIcon, + name: ["ElectricChargingPoint"], + }, + { + icon: KayakingIcon, + name: ["KayaksForLoan"], + }, + { + icon: SkateboardingIcon, + name: ["SkateboardsForLoan"], + }, + { + icon: NightlifeIcon, + name: ["LiveMusicExhibitions"], + }, + { + icon: StoreIcon, + name: ["Shop"], + }, + { + icon: CoffeeIcon, + name: ["Cafe"], + }, + { + icon: BusinessIcon, + name: ["Meeting"], + }, + { + icon: LocalBarIcon, + name: ["Bar"], + }, + { + icon: RoomServiceIcon, + name: ["RoomService"], + }, + { + icon: OutdoorFurnitureIcon, + name: ["OutdoorTerrace"], + }, + { + icon: RestaurantIcon, + name: ["Restaurant"], + }, + { + icon: LocalBarIcon, + name: ["Skybar"], + }, + { + icon: BreakfastIcon, + name: ["Breakfast"], + }, + { + icon: SaunaIcon, + name: ["Sauna"], + }, + { + icon: ConciergeIcon, + name: ["LifestyleConcierge"], + }, + ] + + const icon = iconMappings.find((icon) => icon.name.includes(name)) + return icon ? icon.icon : StarFilledIcon +} diff --git a/components/SidePeeks/HotelSidePeek/index.tsx b/components/SidePeeks/HotelSidePeek/index.tsx index 259c8d16c..3a77ce8dc 100644 --- a/components/SidePeeks/HotelSidePeek/index.tsx +++ b/components/SidePeeks/HotelSidePeek/index.tsx @@ -1,6 +1,7 @@ import { useIntl } from "react-intl" import Contact from "@/components/HotelReservation/Contact" +import { AccessibilityIcon } from "@/components/Icons" import Accordion from "@/components/TempDesignSystem/Accordion" import AccordionItem from "@/components/TempDesignSystem/Accordion/AccordionItem" import Button from "@/components/TempDesignSystem/Button" @@ -8,7 +9,7 @@ import SidePeek from "@/components/TempDesignSystem/SidePeek" import Body from "@/components/TempDesignSystem/Text/Body" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" -import { getFacilityIcon } from "../RoomSidePeek/facilityIcon" +import { getHotelFacilityIcon } from "./hotelFacilityIcon" import styles from "./hotelSidePeek.module.css" @@ -59,10 +60,15 @@ export default function HotelSidePeek({ ) : null}
    + {intl.formatMessage({ id: "Accessibility" })}
    {amenitiesList.map((amenity) => { - const Icon = getFacilityIcon(amenity.icon) + const Icon = getHotelFacilityIcon(amenity.icon) return (
    {Icon && ( diff --git a/components/SidePeeks/RoomSidePeek/facilityIcon.ts b/components/SidePeeks/RoomSidePeek/facilityIcon.ts index d45ce7b30..b131dbd27 100644 --- a/components/SidePeeks/RoomSidePeek/facilityIcon.ts +++ b/components/SidePeeks/RoomSidePeek/facilityIcon.ts @@ -9,13 +9,13 @@ import { DeskIcon, HairdryerIcon, HandSoapIcon, - HeartIcon, IronIcon, MirrorIcon, NatureIcon, NoSmokingIcon, SafetyBoxIcon, ShowerIcon, + StarFilledIcon, StreetIcon, WifiIcon, WindowCurtainsAltIcon, @@ -27,98 +27,101 @@ import { import { IconProps } from "@/types/components/icon" -export function getFacilityIcon(name: string): FC | null { +export function getFacilityIcon( + name: string | undefined +): FC | null { + if (!name) return StarFilledIcon const iconMappings = [ { icon: DeskIcon, - texts: ["Desk and chair"], + name: ["Desk and chair"], }, { icon: HairdryerIcon, - texts: ["Hairdryer"], + name: ["Hairdryer"], }, { icon: AcIcon, - texts: ["Air Condition"], + name: ["Air Condition"], }, { icon: ChairIcon, - texts: ["Armchair / armchairs"], + name: ["Armchair / armchairs"], }, { icon: BathtubIcon, - texts: ["Bathroom with shower or bathtub"], + name: ["Bathroom with shower or bathtub"], }, { icon: WindowCurtainsAltIcon, - texts: ["Blackout curtains"], + name: ["Blackout curtains"], }, { icon: MirrorIcon, - texts: ["Cosmetic mirror"], + name: ["Cosmetic mirror"], }, { icon: WifiIcon, - texts: ["Free WiFi"], + name: ["FreeWiFi"], }, { icon: ChairIcon, - texts: ["Connecting rooms"], + name: ["Connecting rooms"], }, { icon: YardIcon, - texts: ["View - atrium view"], + name: ["View - atrium view"], }, { icon: CityIcon, - texts: ["View - city view"], + name: ["View - city view"], }, { icon: NatureIcon, - texts: ["View - park view"], + name: ["View - park view"], }, { icon: StreetIcon, - texts: ["View - street view"], + name: ["View - street view"], }, { icon: WineBarIcon, - texts: ["Minibar"], + name: ["Minibar"], }, { icon: NoSmokingIcon, - texts: ["Non smoking"], + name: ["Non smoking"], }, { icon: ShowerIcon, - texts: ["Rain shower"], + name: ["Rain shower"], }, { icon: SafetyBoxIcon, - texts: ["Safety box"], + name: ["Safety box"], }, { icon: BedDoubleIcon, - texts: ["Set of two pillows"], + name: ["Set of two pillows"], }, { icon: IronIcon, - texts: ["Iron and ironing board"], + name: ["Iron and ironing board"], }, { icon: HandSoapIcon, - texts: ["Toiletries"], + name: ["Toiletries"], }, { icon: WoodFloorIcon, - texts: ["Wooden floor"], + name: ["Wooden floor"], }, { icon: WindowNotAvailableIcon, - texts: ["Not window"], + name: ["Not window"], }, ] - const icon = iconMappings.find((icon) => icon.texts.includes(name)) - return icon ? icon.icon : HeartIcon + const icon = iconMappings.find((icon) => icon.name.includes(name)) + return icon ? icon.icon : StarFilledIcon } diff --git a/server/routers/hotels/output.ts b/server/routers/hotels/output.ts index 4614fd328..9d3c71194 100644 --- a/server/routers/hotels/output.ts +++ b/server/routers/hotels/output.ts @@ -125,7 +125,7 @@ const detailedFacilitySchema = z.object({ public: z.boolean(), sortOrder: z.number(), filter: z.string().optional(), - icon: z.string(), + icon: z.string().optional(), }) export const facilitySchema = z.object({ diff --git a/server/routers/hotels/schemas/room.ts b/server/routers/hotels/schemas/room.ts index 820242a1f..5141086ed 100644 --- a/server/routers/hotels/schemas/room.ts +++ b/server/routers/hotels/schemas/room.ts @@ -56,7 +56,7 @@ const roomFacilitiesSchema = z.object({ name: z.string(), isUniqueSellingPoint: z.boolean(), sortOrder: z.number(), - icon: z.string(), + icon: z.string().optional(), }) export const roomSchema = z From 9693803626c1b82f7bfca445bf1f663aa2360b66 Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Thu, 21 Nov 2024 15:20:18 +0100 Subject: [PATCH 3/5] feat(SW-938) use mapFacilityToIcon --- .../HotelSidePeek/hotelFacilityIcon.ts | 157 ------------------ components/SidePeeks/HotelSidePeek/index.tsx | 5 +- 2 files changed, 2 insertions(+), 160 deletions(-) delete mode 100644 components/SidePeeks/HotelSidePeek/hotelFacilityIcon.ts diff --git a/components/SidePeeks/HotelSidePeek/hotelFacilityIcon.ts b/components/SidePeeks/HotelSidePeek/hotelFacilityIcon.ts deleted file mode 100644 index 3bf8fc496..000000000 --- a/components/SidePeeks/HotelSidePeek/hotelFacilityIcon.ts +++ /dev/null @@ -1,157 +0,0 @@ -import { FC } from "react" - -import { - AcIcon, - BarIcon, - BathtubIcon, - BedDoubleIcon, - BikeIcon, - BikingIcon, - BreakfastIcon, - BusinessIcon, - ChairIcon, - CityIcon, - CoffeeIcon, - ConciergeIcon, - DeskIcon, - ElectricBikeIcon, - ElectricCarIcon, - FitnessIcon, - GarageIcon, - HairdryerIcon, - HandSoapIcon, - HeartIcon, - IronIcon, - KayakingIcon, - LaundryMachineIcon, - LocalBarIcon, - MirrorIcon, - NatureIcon, - NightlifeIcon, - NoSmokingIcon, - OutdoorFurnitureIcon, - ParkingIcon, - RestaurantIcon, - RoomServiceIcon, - SafetyBoxIcon, - SaunaIcon, - ShoppingIcon, - ShowerIcon, - SkateboardingIcon, - StarFilledIcon, - StoreIcon, - StreetIcon, - SwimIcon, - WifiIcon, - WindowCurtainsAltIcon, - WindowNotAvailableIcon, - WineBarIcon, - WoodFloorIcon, - YardIcon, -} from "@/components/Icons" - -import { IconProps } from "@/types/components/icon" - -export function getHotelFacilityIcon( - name: string | undefined -): FC | null { - if (!name) return StarFilledIcon - - const iconMappings = [ - { - icon: FitnessIcon, - name: ["Gym"], - }, - { - icon: SwimIcon, - name: ["Pool"], - }, - { - icon: WifiIcon, - name: ["FreeWiFi"], - }, - { - icon: LaundryMachineIcon, - name: ["LaundryService"], - }, - { - icon: LaundryMachineIcon, - name: ["ExpressLaundryService"], - }, - { - icon: ParkingIcon, - name: ["Parking"], - }, - { - icon: GarageIcon, - name: ["Garage"], - }, - { - icon: BikeIcon, - name: ["BikesForLoan"], - }, - { - icon: ElectricCarIcon, - name: ["ElectricChargingPoint"], - }, - { - icon: KayakingIcon, - name: ["KayaksForLoan"], - }, - { - icon: SkateboardingIcon, - name: ["SkateboardsForLoan"], - }, - { - icon: NightlifeIcon, - name: ["LiveMusicExhibitions"], - }, - { - icon: StoreIcon, - name: ["Shop"], - }, - { - icon: CoffeeIcon, - name: ["Cafe"], - }, - { - icon: BusinessIcon, - name: ["Meeting"], - }, - { - icon: LocalBarIcon, - name: ["Bar"], - }, - { - icon: RoomServiceIcon, - name: ["RoomService"], - }, - { - icon: OutdoorFurnitureIcon, - name: ["OutdoorTerrace"], - }, - { - icon: RestaurantIcon, - name: ["Restaurant"], - }, - { - icon: LocalBarIcon, - name: ["Skybar"], - }, - { - icon: BreakfastIcon, - name: ["Breakfast"], - }, - { - icon: SaunaIcon, - name: ["Sauna"], - }, - { - icon: ConciergeIcon, - name: ["LifestyleConcierge"], - }, - ] - - const icon = iconMappings.find((icon) => icon.name.includes(name)) - return icon ? icon.icon : StarFilledIcon -} diff --git a/components/SidePeeks/HotelSidePeek/index.tsx b/components/SidePeeks/HotelSidePeek/index.tsx index 3a77ce8dc..b26570bb7 100644 --- a/components/SidePeeks/HotelSidePeek/index.tsx +++ b/components/SidePeeks/HotelSidePeek/index.tsx @@ -1,5 +1,6 @@ import { useIntl } from "react-intl" +import { mapFacilityToIcon } from "@/components/ContentType/HotelPage/data" import Contact from "@/components/HotelReservation/Contact" import { AccessibilityIcon } from "@/components/Icons" import Accordion from "@/components/TempDesignSystem/Accordion" @@ -9,8 +10,6 @@ import SidePeek from "@/components/TempDesignSystem/SidePeek" import Body from "@/components/TempDesignSystem/Text/Body" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" -import { getHotelFacilityIcon } from "./hotelFacilityIcon" - import styles from "./hotelSidePeek.module.css" import type { HotelSidePeekProps } from "@/types/components/hotelReservation/hotelSidePeek" @@ -68,7 +67,7 @@ export default function HotelSidePeek({ {intl.formatMessage({ id: "Accessibility" })}
    {amenitiesList.map((amenity) => { - const Icon = getHotelFacilityIcon(amenity.icon) + const Icon = mapFacilityToIcon(amenity.id) return (
    {Icon && ( From 1f32f77846e2a7596e529b52126e2afa295f4a13 Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Fri, 22 Nov 2024 10:11:26 +0100 Subject: [PATCH 4/5] feat(SW-938) Added icons to room facility --- components/Icons/Balcony.tsx | 23 ++ components/Icons/BedHotel.tsx | 27 ++ components/Icons/BedroomParent.tsx | 27 ++ components/Icons/Cable.tsx | 23 ++ components/Icons/CoffeeMaker.tsx | 27 ++ components/Icons/Dining.tsx | 23 ++ components/Icons/Family.tsx | 23 ++ components/Icons/HealthBeauty.tsx | 27 ++ components/Icons/Laptop.tsx | 23 ++ components/Icons/Luggage.tsx | 23 ++ components/Icons/Microwave.tsx | 27 ++ components/Icons/Speaker.tsx | 23 ++ components/Icons/index.tsx | 12 + .../SidePeeks/RoomSidePeek/facilityIcon.ts | 287 ++++++++++++------ 14 files changed, 504 insertions(+), 91 deletions(-) create mode 100644 components/Icons/Balcony.tsx create mode 100644 components/Icons/BedHotel.tsx create mode 100644 components/Icons/BedroomParent.tsx create mode 100644 components/Icons/Cable.tsx create mode 100644 components/Icons/CoffeeMaker.tsx create mode 100644 components/Icons/Dining.tsx create mode 100644 components/Icons/Family.tsx create mode 100644 components/Icons/HealthBeauty.tsx create mode 100644 components/Icons/Laptop.tsx create mode 100644 components/Icons/Luggage.tsx create mode 100644 components/Icons/Microwave.tsx create mode 100644 components/Icons/Speaker.tsx diff --git a/components/Icons/Balcony.tsx b/components/Icons/Balcony.tsx new file mode 100644 index 000000000..e0fc4c020 --- /dev/null +++ b/components/Icons/Balcony.tsx @@ -0,0 +1,23 @@ +import { iconVariants } from "./variants" + +import type { IconProps } from "@/types/components/icon" + +export default function BalconyIcon({ className, color, ...props }: IconProps) { + const classNames = iconVariants({ className, color }) + return ( + + + + ) +} diff --git a/components/Icons/BedHotel.tsx b/components/Icons/BedHotel.tsx new file mode 100644 index 000000000..d2f37b0ed --- /dev/null +++ b/components/Icons/BedHotel.tsx @@ -0,0 +1,27 @@ +import { iconVariants } from "./variants" + +import type { IconProps } from "@/types/components/icon" + +export default function BedHotelIcon({ + className, + color, + ...props +}: IconProps) { + const classNames = iconVariants({ className, color }) + return ( + + + + ) +} diff --git a/components/Icons/BedroomParent.tsx b/components/Icons/BedroomParent.tsx new file mode 100644 index 000000000..c7bdf7868 --- /dev/null +++ b/components/Icons/BedroomParent.tsx @@ -0,0 +1,27 @@ +import { iconVariants } from "./variants" + +import type { IconProps } from "@/types/components/icon" + +export default function BedroomParentIcon({ + className, + color, + ...props +}: IconProps) { + const classNames = iconVariants({ className, color }) + return ( + + + + ) +} diff --git a/components/Icons/Cable.tsx b/components/Icons/Cable.tsx new file mode 100644 index 000000000..493994d60 --- /dev/null +++ b/components/Icons/Cable.tsx @@ -0,0 +1,23 @@ +import { iconVariants } from "./variants" + +import type { IconProps } from "@/types/components/icon" + +export default function CableIcon({ className, color, ...props }: IconProps) { + const classNames = iconVariants({ className, color }) + return ( + + + + ) +} diff --git a/components/Icons/CoffeeMaker.tsx b/components/Icons/CoffeeMaker.tsx new file mode 100644 index 000000000..8d9dbf460 --- /dev/null +++ b/components/Icons/CoffeeMaker.tsx @@ -0,0 +1,27 @@ +import { iconVariants } from "./variants" + +import type { IconProps } from "@/types/components/icon" + +export default function CoffeeMakerIcon({ + className, + color, + ...props +}: IconProps) { + const classNames = iconVariants({ className, color }) + return ( + + + + ) +} diff --git a/components/Icons/Dining.tsx b/components/Icons/Dining.tsx new file mode 100644 index 000000000..5fcab7d1b --- /dev/null +++ b/components/Icons/Dining.tsx @@ -0,0 +1,23 @@ +import { iconVariants } from "./variants" + +import type { IconProps } from "@/types/components/icon" + +export default function DiningIcon({ className, color, ...props }: IconProps) { + const classNames = iconVariants({ className, color }) + return ( + + + + ) +} diff --git a/components/Icons/Family.tsx b/components/Icons/Family.tsx new file mode 100644 index 000000000..3f0547be8 --- /dev/null +++ b/components/Icons/Family.tsx @@ -0,0 +1,23 @@ +import { iconVariants } from "./variants" + +import type { IconProps } from "@/types/components/icon" + +export default function FamilyIcon({ className, color, ...props }: IconProps) { + const classNames = iconVariants({ className, color }) + return ( + + + + ) +} diff --git a/components/Icons/HealthBeauty.tsx b/components/Icons/HealthBeauty.tsx new file mode 100644 index 000000000..90e505325 --- /dev/null +++ b/components/Icons/HealthBeauty.tsx @@ -0,0 +1,27 @@ +import { iconVariants } from "./variants" + +import type { IconProps } from "@/types/components/icon" + +export default function HealthBeautyIcon({ + className, + color, + ...props +}: IconProps) { + const classNames = iconVariants({ className, color }) + return ( + + + + ) +} diff --git a/components/Icons/Laptop.tsx b/components/Icons/Laptop.tsx new file mode 100644 index 000000000..932efb949 --- /dev/null +++ b/components/Icons/Laptop.tsx @@ -0,0 +1,23 @@ +import { iconVariants } from "./variants" + +import type { IconProps } from "@/types/components/icon" + +export default function LaptopIcon({ className, color, ...props }: IconProps) { + const classNames = iconVariants({ className, color }) + return ( + + + + ) +} diff --git a/components/Icons/Luggage.tsx b/components/Icons/Luggage.tsx new file mode 100644 index 000000000..e4cf0ba21 --- /dev/null +++ b/components/Icons/Luggage.tsx @@ -0,0 +1,23 @@ +import { iconVariants } from "./variants" + +import type { IconProps } from "@/types/components/icon" + +export default function LuggageIcon({ className, color, ...props }: IconProps) { + const classNames = iconVariants({ className, color }) + return ( + + + + ) +} diff --git a/components/Icons/Microwave.tsx b/components/Icons/Microwave.tsx new file mode 100644 index 000000000..ce4c73752 --- /dev/null +++ b/components/Icons/Microwave.tsx @@ -0,0 +1,27 @@ +import { iconVariants } from "./variants" + +import type { IconProps } from "@/types/components/icon" + +export default function MicrowaveIcon({ + className, + color, + ...props +}: IconProps) { + const classNames = iconVariants({ className, color }) + return ( + + + + ) +} diff --git a/components/Icons/Speaker.tsx b/components/Icons/Speaker.tsx new file mode 100644 index 000000000..eeb76d4d5 --- /dev/null +++ b/components/Icons/Speaker.tsx @@ -0,0 +1,23 @@ +import { iconVariants } from "./variants" + +import type { IconProps } from "@/types/components/icon" + +export default function SpeakerIcon({ className, color, ...props }: IconProps) { + const classNames = iconVariants({ className, color }) + return ( + + + + ) +} diff --git a/components/Icons/index.tsx b/components/Icons/index.tsx index 26ca0d7ba..b8d3ef8d9 100644 --- a/components/Icons/index.tsx +++ b/components/Icons/index.tsx @@ -7,14 +7,18 @@ export { default as AirplaneIcon } from "./Airplane" export { default as AllergyIcon } from "./Allergy" export { default as ArrowRightIcon } from "./ArrowRight" export { default as ArrowUpIcon } from "./ArrowUp" +export { default as BalconyIcon } from "./Balcony" export { default as BarIcon } from "./Bar" export { default as BathtubIcon } from "./Bathtub" export { default as BedDoubleIcon } from "./BedDouble" +export { default as BedHotelIcon } from "./BedHotel" +export { default as BedroomParentIcon } from "./BedroomParent" export { default as BedSingleIcon } from "./BedSingle" export { default as BikeIcon } from "./Bike" export { default as BikingIcon } from "./Biking" export { default as BreakfastIcon } from "./Breakfast" export { default as BusinessIcon } from "./Business" +export { default as CableIcon } from "./Cable" export { default as CalendarIcon } from "./Calendar" export { default as CameraIcon } from "./Camera" export { default as CellphoneIcon } from "./Cellphone" @@ -34,6 +38,7 @@ export { default as CloseIcon } from "./Close" export { default as CloseLargeIcon } from "./CloseLarge" export { default as CoffeeIcon } from "./Coffee" export { default as CoffeeAltIcon } from "./CoffeeAlt" +export { default as CoffeeMakerIcon } from "./CoffeeMaker" export { default as ConciergeIcon } from "./Concierge" export { default as ContractIcon } from "./Contract" export { default as ConvenienceStore24hIcon } from "./ConvenienceStore24h" @@ -44,6 +49,7 @@ export { default as CrossCircle } from "./CrossCircle" export { default as CulturalIcon } from "./Cultural" export { default as DeleteIcon } from "./Delete" export { default as DeskIcon } from "./Desk" +export { default as DiningIcon } from "./Dining" export { default as DiscountIcon } from "./Discount" export { default as DoorClosedIcon } from "./DoorClosed" export { default as DoorOpenIcon } from "./DoorOpen" @@ -57,6 +63,7 @@ export { default as ErrorCircleIcon } from "./ErrorCircle" export { default as EyeHideIcon } from "./EyeHide" export { default as EyeShowIcon } from "./EyeShow" export { default as FacebookIcon } from "./Facebook" +export { default as FamilyIcon } from "./Family" export { default as FanIcon } from "./Fan" export { default as FilterIcon } from "./Filter" export { default as FitnessIcon } from "./Fitness" @@ -71,6 +78,7 @@ export { default as HairdryerIcon } from "./Hairdryer" export { default as HandSoapIcon } from "./HandSoap" export { default as HangerIcon } from "./Hanger" export { default as HangerAltIcon } from "./HangerAlt" +export { default as HealthBeautyIcon } from "./HealthBeauty" export { default as HeartIcon } from "./Heart" export { default as HeatIcon } from "./Heat" export { default as HouseIcon } from "./House" @@ -83,6 +91,7 @@ export { default as KettleIcon } from "./Kettle" export { default as KingBedIcon } from "./KingBed" export { default as KingBedSmallIcon } from "./KingBedSmall" export { default as LampIcon } from "./Lamp" +export { default as LaptopIcon } from "./Laptop" export { default as LaundryMachineIcon } from "./LaundryMachine" export { default as LocalBarIcon } from "./LocalBar" export { default as LocationIcon } from "./Location" @@ -94,7 +103,9 @@ export { default as HotelNorgeIcon } from "./Logos/HotelNorge" export { default as MarskiLogoIcon } from "./Logos/Marski" export { default as ScandicGoLogoIcon } from "./Logos/ScandicGoLogo" export { default as ScandicLogoIcon } from "./Logos/ScandicLogo" +export { default as LuggageIcon } from "./Luggage" export { default as MapIcon } from "./Map" +export { default as MicrowaveIcon } from "./Microwave" export { default as MinusIcon } from "./Minus" export { default as MirrorIcon } from "./Mirror" export { default as MuseumIcon } from "./Museum" @@ -124,6 +135,7 @@ export { default as SkateboardingIcon } from "./Skateboarding" export { default as SmokingIcon } from "./Smoking" export { default as SnowflakeIcon } from "./Snowflake" export { default as SpaIcon } from "./Spa" +export { default as SpeakerIcon } from "./Speaker" export { default as StarFilledIcon } from "./StarFilled" export { default as StoreIcon } from "./Store" export { default as StreetIcon } from "./Street" diff --git a/components/SidePeeks/RoomSidePeek/facilityIcon.ts b/components/SidePeeks/RoomSidePeek/facilityIcon.ts index b131dbd27..1aa6eab36 100644 --- a/components/SidePeeks/RoomSidePeek/facilityIcon.ts +++ b/components/SidePeeks/RoomSidePeek/facilityIcon.ts @@ -2,21 +2,61 @@ import { FC } from "react" import { AcIcon, + AirplaneIcon, + BalconyIcon, BathtubIcon, BedDoubleIcon, + BedHotelIcon, + BedroomParentIcon, + BedSingleIcon, + BikeIcon, + BreakfastIcon, + BusinessIcon, + CableIcon, ChairIcon, CityIcon, + CoffeeAltIcon, + CoffeeIcon, + CoffeeMakerIcon, + ConciergeIcon, + CoolIcon, DeskIcon, + DiningIcon, + ElectricBikeIcon, + FamilyIcon, + FitnessIcon, + FootstoolIcon, HairdryerIcon, HandSoapIcon, + HealthBeautyIcon, + HeartIcon, IronIcon, + KayakingIcon, + KettleIcon, + LaptopIcon, + LaundryMachineIcon, + LocalBarIcon, + LuggageIcon, + MicrowaveIcon, MirrorIcon, NatureIcon, + NightlifeIcon, NoSmokingIcon, + OutdoorFurnitureIcon, + ParkingIcon, + PetsIcon, + PhoneIcon, + RestaurantIcon, + RoomServiceIcon, SafetyBoxIcon, + SaunaIcon, ShowerIcon, - StarFilledIcon, + SpeakerIcon, + StoreIcon, StreetIcon, + SwimIcon, + TshirtWashIcon, + TvCastingIcon, WifiIcon, WindowCurtainsAltIcon, WindowNotAvailableIcon, @@ -30,98 +70,163 @@ import { IconProps } from "@/types/components/icon" export function getFacilityIcon( name: string | undefined ): FC | null { - if (!name) return StarFilledIcon + if (!name) return HeartIcon const iconMappings = [ - { - icon: DeskIcon, - name: ["Desk and chair"], - }, - { - icon: HairdryerIcon, - name: ["Hairdryer"], - }, - { - icon: AcIcon, - name: ["Air Condition"], - }, - { - icon: ChairIcon, - name: ["Armchair / armchairs"], - }, - { - icon: BathtubIcon, - name: ["Bathroom with shower or bathtub"], - }, - { - icon: WindowCurtainsAltIcon, - name: ["Blackout curtains"], - }, - { - icon: MirrorIcon, - name: ["Cosmetic mirror"], - }, - { - icon: WifiIcon, - name: ["FreeWiFi"], - }, - { - icon: ChairIcon, - name: ["Connecting rooms"], - }, - { - icon: YardIcon, - name: ["View - atrium view"], - }, - { - icon: CityIcon, - name: ["View - city view"], - }, - { - icon: NatureIcon, - name: ["View - park view"], - }, - { - icon: StreetIcon, - name: ["View - street view"], - }, - { - icon: WineBarIcon, - name: ["Minibar"], - }, - { - icon: NoSmokingIcon, - name: ["Non smoking"], - }, - { - icon: ShowerIcon, - name: ["Rain shower"], - }, - { - icon: SafetyBoxIcon, - name: ["Safety box"], - }, - { - icon: BedDoubleIcon, - name: ["Set of two pillows"], - }, - { - icon: IronIcon, - name: ["Iron and ironing board"], - }, - { - icon: HandSoapIcon, - name: ["Toiletries"], - }, - { - icon: WoodFloorIcon, - name: ["Wooden floor"], - }, - { - icon: WindowNotAvailableIcon, - name: ["Not window"], - }, + { icon: AcIcon, name: ["AirCondition"] }, + { icon: AirplaneIcon, name: ["Airport"] }, + { icon: BalconyIcon, name: ["Balcony"] }, + { icon: BalconyIcon, name: ["BalconyOrTerrace"] }, + { icon: BalconyIcon, name: ["FrenchBalcony"] }, + { icon: BathtubIcon, name: ["BathroomWithBathtub"] }, + { icon: BathtubIcon, name: ["BathroomWithShowerAndBathtub"] }, + { icon: BathtubIcon, name: ["BathroomWithShowerOrBathtub"] }, + { icon: BedDoubleIcon, name: ["AdjustableBeds"] }, + { icon: BedDoubleIcon, name: ["SetOfTwoPillows"] }, + { icon: BedHotelIcon, name: ["ArmchairBed"] }, + { icon: BedHotelIcon, name: ["PullOutBed"] }, + { icon: BedroomParentIcon, name: ["SeparateBedroom"] }, + { icon: BedSingleIcon, name: ["ExtraBed"] }, + { icon: BikeIcon, name: ["BikeForLoan"] }, + { icon: BreakfastIcon, name: ["Breakfast"] }, + { icon: BreakfastIcon, name: ["ServesBreakfastAlwaysIncluded"] }, + { icon: BusinessIcon, name: ["MeetingConferenceFacilities"] }, + { icon: BusinessIcon, name: ["Meetingrooms"] }, + { icon: CableIcon, name: ["InternetWithCableInTheRoom"] }, + { icon: ChairIcon, name: ["Armchair"] }, + { icon: ChairIcon, name: ["ConnectingRooms"] }, + { icon: CityIcon, name: ["ViewCityView"] }, + { icon: CoffeeAltIcon, name: ["NespressoMachine"] }, + { icon: CoffeeIcon, name: ["Café"] }, + { icon: CoffeeIcon, name: ["Coffee"] }, + { icon: CoffeeMakerIcon, name: ["CoffeeMachine"] }, + { icon: ConciergeIcon, name: ["LifestyleConcierge"] }, + { icon: CoolIcon, name: ["AirCooling"] }, + { icon: CoolIcon, name: ["Cooler"] }, + { icon: CoolIcon, name: ["CoolingCabinet"] }, + { icon: DeskIcon, name: ["DeskAndChair"] }, + { icon: DiningIcon, name: ["DiningArea"] }, + { icon: DiningIcon, name: ["TableForDining"] }, + { icon: ElectricBikeIcon, name: ["EBikesChargingStation"] }, + { icon: FamilyIcon, name: ["ExtraFamilyFriendly"] }, + { icon: FitnessIcon, name: ["Gym"] }, + { icon: FootstoolIcon, name: ["FootStool"] }, + { icon: HairdryerIcon, name: ["Hairdryer"] }, + { icon: HandSoapIcon, name: ["Toiletries"] }, + { icon: HealthBeautyIcon, name: ["BeautySalon"] }, + { icon: HeartIcon, name: ["Bathrobes"] }, + { icon: HeartIcon, name: ["Bathroom2SeparateBathrooms"] }, + { icon: HeartIcon, name: ["BodyCareProducts"] }, + { icon: HeartIcon, name: ["BodyLotion"] }, + { icon: HeartIcon, name: ["Bowling"] }, + { icon: HeartIcon, name: ["BunkBed"] }, + { icon: HeartIcon, name: ["BunkBed80x188Cm"] }, + { icon: HeartIcon, name: ["CarpetingWallToWallCarpet"] }, + { icon: HeartIcon, name: ["CashFree800pmTill0600am"] }, + { icon: HeartIcon, name: ["CashFreeHotel"] }, + { icon: HeartIcon, name: ["CoffeeVoucher"] }, + { icon: HeartIcon, name: ["ComplimentaryColdRefreshments"] }, + { icon: HeartIcon, name: ["Conditioner"] }, + { icon: HeartIcon, name: ["ConventionCentre"] }, + { icon: HeartIcon, name: ["DisabledParking"] }, + { icon: HeartIcon, name: ["DockingStationForiPodiPad"] }, + { icon: HeartIcon, name: ["DryingCabinet"] }, + { icon: HeartIcon, name: ["EasyAccess"] }, + { icon: HeartIcon, name: ["GarmentSteamer"] }, + { icon: HeartIcon, name: ["HighFloor"] }, + { icon: HeartIcon, name: ["IceMachine"] }, + { icon: HeartIcon, name: ["IceMachineReception"] }, + { icon: HeartIcon, name: ["Jaccuzzi"] }, + { icon: HeartIcon, name: ["Jacuzzi"] }, + { icon: HeartIcon, name: ["Kitchen"] }, + { icon: HeartIcon, name: ["Kitchenette"] }, + { icon: HeartIcon, name: ["LateCheckOutUntil1400Guaranteed"] }, + { icon: HeartIcon, name: ["LiveMusicExhibitions"] }, + { icon: HeartIcon, name: ["Massage"] }, + { icon: HeartIcon, name: ["MeetingArea"] }, + { icon: HeartIcon, name: ["MinibarIncludedInRoomRate"] }, + { icon: HeartIcon, name: ["OvernightSecurity"] }, + { icon: HeartIcon, name: ["ParkingAdditionalcost"] }, + { icon: HeartIcon, name: ["PrivateSauna"] }, + { icon: HeartIcon, name: ["Refrigerator"] }, + { icon: HeartIcon, name: ["SeatingArea"] }, + { icon: HeartIcon, name: ["Security24Hoours"] }, + { icon: HeartIcon, name: ["SeparateLivingRoom"] }, + { icon: HeartIcon, name: ["SeparateToilet"] }, + { icon: HeartIcon, name: ["ServiceSecurity24h"] }, + { icon: HeartIcon, name: ["Shampoo"] }, + { icon: HeartIcon, name: ["Slippers"] }, + { icon: HeartIcon, name: ["Sofabed"] }, + { icon: HeartIcon, name: ["Sofas"] }, + { icon: HeartIcon, name: ["SofaWithTable"] }, + { icon: HeartIcon, name: ["SpaciousRoom"] }, + { icon: HeartIcon, name: ["StillAndSparklingWater"] }, + { icon: HeartIcon, name: ["Table"] }, + { icon: HeartIcon, name: ["TassimoCoffeeMaker"] }, + { icon: HeartIcon, name: ["Terrace"] }, + { icon: HeartIcon, name: ["TrouserPress"] }, + { icon: HeartIcon, name: ["TV"] }, + { icon: HeartIcon, name: ["TVWithComplimentaryMovieChannels"] }, + { icon: HeartIcon, name: ["TVWithMovieChannels"] }, + { icon: HeartIcon, name: ["TVWithStreamingOption"] }, + { icon: HeartIcon, name: ["VentilationInRoom"] }, + { icon: HeartIcon, name: ["View"] }, + { icon: HeartIcon, name: ["ViewFjordView"] }, + { icon: HeartIcon, name: ["ViewLakeView"] }, + { icon: HeartIcon, name: ["ViewPanoramicView"] }, + { icon: HeartIcon, name: ["ViewSeaView"] }, + { icon: HeartIcon, name: ["WallBed"] }, + { icon: HeartIcon, name: ["WallMountedCycleRack"] }, + { icon: HeartIcon, name: ["Wardrobe"] }, + { icon: HeartIcon, name: ["WellnessAndSaunaEntranceFeeAdmission16Years"] }, + { icon: HeartIcon, name: ["WellnessPoolSaunaEntranceFeeAdmission16Years"] }, + { icon: HeartIcon, name: ["WindowNook"] }, + { icon: IronIcon, name: ["IronAndIroningBoard"] }, + { icon: IronIcon, name: ["IroningRoom"] }, + { icon: KayakingIcon, name: ["KayaksForLoan"] }, + { icon: KettleIcon, name: ["Kettle"] }, + { icon: KettleIcon, name: ["KettleWithCoffeeTea"] }, + { icon: LaptopIcon, name: ["LaptopSafe"] }, + { icon: LaptopIcon, name: ["LaptopTray"] }, + { icon: LaundryMachineIcon, name: ["LaundryService"] }, + { icon: LocalBarIcon, name: ["Bar"] }, + { icon: LocalBarIcon, name: ["RooftopBar"] }, + { icon: LocalBarIcon, name: ["Skybar"] }, + { icon: LuggageIcon, name: ["LuggageLockers"] }, + { icon: MicrowaveIcon, name: ["Microwave"] }, + { icon: MirrorIcon, name: ["CosmeticMirror"] }, + { icon: NatureIcon, name: ["ViewParkView"] }, + { icon: NightlifeIcon, name: ["DiscoNightClub"] }, + { icon: NoSmokingIcon, name: ["NonSmoking"] }, + { icon: OutdoorFurnitureIcon, name: ["OutdoorTerrace"] }, + { icon: ParkingIcon, name: ["Parking"] }, + { icon: ParkingIcon, name: ["ParkingFreeParking"] }, + { icon: PetsIcon, name: ["PetFriendlyRooms"] }, + { icon: PhoneIcon, name: ["DirectDialPhoneAndVoiceMail"] }, + { icon: RestaurantIcon, name: ["Restaurant"] }, + { icon: RoomServiceIcon, name: ["Roomservice"] }, + { icon: SafetyBoxIcon, name: ["SafetyBox"] }, + { icon: SaunaIcon, name: ["Sauna"] }, + { icon: ShowerIcon, name: ["BathroomWithShower"] }, + { icon: ShowerIcon, name: ["RainShower"] }, + { icon: ShowerIcon, name: ["SharedBathroomWithShower"] }, + { icon: ShowerIcon, name: ["ShowerGel"] }, + { icon: ShowerIcon, name: ["ShowerProductsScentByGrandCentral"] }, + { icon: SpeakerIcon, name: ["ModernVinylplayer"] }, + { icon: SpeakerIcon, name: ["MusicPlayer"] }, + { icon: StoreIcon, name: ["Hairdresser"] }, + { icon: StoreIcon, name: ["Shop"] }, + { icon: StreetIcon, name: ["ViewStreetView"] }, + { icon: SwimIcon, name: ["Pool"] }, + { icon: TshirtWashIcon, name: ["HandWash"] }, + { icon: TvCastingIcon, name: ["TVWithChromecast"] }, + { icon: WifiIcon, name: ["FreeWifi"] }, + { icon: WindowCurtainsAltIcon, name: ["BlackoutCurtains"] }, + { icon: WindowNotAvailableIcon, name: ["NoWindow"] }, + { icon: WineBarIcon, name: ["Minibar"] }, + { icon: WoodFloorIcon, name: ["WoodenFloor"] }, + { icon: YardIcon, name: ["ViewAtriumView"] }, ] const icon = iconMappings.find((icon) => icon.name.includes(name)) - return icon ? icon.icon : StarFilledIcon + return icon ? icon.icon : HeartIcon } From ff5859fad173dc2b34c05f6ee10b3361d6e97405 Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Fri, 22 Nov 2024 10:41:07 +0100 Subject: [PATCH 5/5] feat(SW-938) added normalizedName --- .../SidePeeks/RoomSidePeek/facilityIcon.ts | 318 +++++++++--------- 1 file changed, 163 insertions(+), 155 deletions(-) diff --git a/components/SidePeeks/RoomSidePeek/facilityIcon.ts b/components/SidePeeks/RoomSidePeek/facilityIcon.ts index 1aa6eab36..f86329504 100644 --- a/components/SidePeeks/RoomSidePeek/facilityIcon.ts +++ b/components/SidePeeks/RoomSidePeek/facilityIcon.ts @@ -70,163 +70,171 @@ import { IconProps } from "@/types/components/icon" export function getFacilityIcon( name: string | undefined ): FC | null { - if (!name) return HeartIcon + if (!name) { + return HeartIcon + } + + const normalizedName = name.toLowerCase() + const iconMappings = [ - { icon: AcIcon, name: ["AirCondition"] }, - { icon: AirplaneIcon, name: ["Airport"] }, - { icon: BalconyIcon, name: ["Balcony"] }, - { icon: BalconyIcon, name: ["BalconyOrTerrace"] }, - { icon: BalconyIcon, name: ["FrenchBalcony"] }, - { icon: BathtubIcon, name: ["BathroomWithBathtub"] }, - { icon: BathtubIcon, name: ["BathroomWithShowerAndBathtub"] }, - { icon: BathtubIcon, name: ["BathroomWithShowerOrBathtub"] }, - { icon: BedDoubleIcon, name: ["AdjustableBeds"] }, - { icon: BedDoubleIcon, name: ["SetOfTwoPillows"] }, - { icon: BedHotelIcon, name: ["ArmchairBed"] }, - { icon: BedHotelIcon, name: ["PullOutBed"] }, - { icon: BedroomParentIcon, name: ["SeparateBedroom"] }, - { icon: BedSingleIcon, name: ["ExtraBed"] }, - { icon: BikeIcon, name: ["BikeForLoan"] }, - { icon: BreakfastIcon, name: ["Breakfast"] }, - { icon: BreakfastIcon, name: ["ServesBreakfastAlwaysIncluded"] }, - { icon: BusinessIcon, name: ["MeetingConferenceFacilities"] }, - { icon: BusinessIcon, name: ["Meetingrooms"] }, - { icon: CableIcon, name: ["InternetWithCableInTheRoom"] }, - { icon: ChairIcon, name: ["Armchair"] }, - { icon: ChairIcon, name: ["ConnectingRooms"] }, - { icon: CityIcon, name: ["ViewCityView"] }, - { icon: CoffeeAltIcon, name: ["NespressoMachine"] }, - { icon: CoffeeIcon, name: ["Café"] }, - { icon: CoffeeIcon, name: ["Coffee"] }, - { icon: CoffeeMakerIcon, name: ["CoffeeMachine"] }, - { icon: ConciergeIcon, name: ["LifestyleConcierge"] }, - { icon: CoolIcon, name: ["AirCooling"] }, - { icon: CoolIcon, name: ["Cooler"] }, - { icon: CoolIcon, name: ["CoolingCabinet"] }, - { icon: DeskIcon, name: ["DeskAndChair"] }, - { icon: DiningIcon, name: ["DiningArea"] }, - { icon: DiningIcon, name: ["TableForDining"] }, - { icon: ElectricBikeIcon, name: ["EBikesChargingStation"] }, - { icon: FamilyIcon, name: ["ExtraFamilyFriendly"] }, - { icon: FitnessIcon, name: ["Gym"] }, - { icon: FootstoolIcon, name: ["FootStool"] }, - { icon: HairdryerIcon, name: ["Hairdryer"] }, - { icon: HandSoapIcon, name: ["Toiletries"] }, - { icon: HealthBeautyIcon, name: ["BeautySalon"] }, - { icon: HeartIcon, name: ["Bathrobes"] }, - { icon: HeartIcon, name: ["Bathroom2SeparateBathrooms"] }, - { icon: HeartIcon, name: ["BodyCareProducts"] }, - { icon: HeartIcon, name: ["BodyLotion"] }, - { icon: HeartIcon, name: ["Bowling"] }, - { icon: HeartIcon, name: ["BunkBed"] }, - { icon: HeartIcon, name: ["BunkBed80x188Cm"] }, - { icon: HeartIcon, name: ["CarpetingWallToWallCarpet"] }, - { icon: HeartIcon, name: ["CashFree800pmTill0600am"] }, - { icon: HeartIcon, name: ["CashFreeHotel"] }, - { icon: HeartIcon, name: ["CoffeeVoucher"] }, - { icon: HeartIcon, name: ["ComplimentaryColdRefreshments"] }, - { icon: HeartIcon, name: ["Conditioner"] }, - { icon: HeartIcon, name: ["ConventionCentre"] }, - { icon: HeartIcon, name: ["DisabledParking"] }, - { icon: HeartIcon, name: ["DockingStationForiPodiPad"] }, - { icon: HeartIcon, name: ["DryingCabinet"] }, - { icon: HeartIcon, name: ["EasyAccess"] }, - { icon: HeartIcon, name: ["GarmentSteamer"] }, - { icon: HeartIcon, name: ["HighFloor"] }, - { icon: HeartIcon, name: ["IceMachine"] }, - { icon: HeartIcon, name: ["IceMachineReception"] }, - { icon: HeartIcon, name: ["Jaccuzzi"] }, - { icon: HeartIcon, name: ["Jacuzzi"] }, - { icon: HeartIcon, name: ["Kitchen"] }, - { icon: HeartIcon, name: ["Kitchenette"] }, - { icon: HeartIcon, name: ["LateCheckOutUntil1400Guaranteed"] }, - { icon: HeartIcon, name: ["LiveMusicExhibitions"] }, - { icon: HeartIcon, name: ["Massage"] }, - { icon: HeartIcon, name: ["MeetingArea"] }, - { icon: HeartIcon, name: ["MinibarIncludedInRoomRate"] }, - { icon: HeartIcon, name: ["OvernightSecurity"] }, - { icon: HeartIcon, name: ["ParkingAdditionalcost"] }, - { icon: HeartIcon, name: ["PrivateSauna"] }, - { icon: HeartIcon, name: ["Refrigerator"] }, - { icon: HeartIcon, name: ["SeatingArea"] }, - { icon: HeartIcon, name: ["Security24Hoours"] }, - { icon: HeartIcon, name: ["SeparateLivingRoom"] }, - { icon: HeartIcon, name: ["SeparateToilet"] }, - { icon: HeartIcon, name: ["ServiceSecurity24h"] }, - { icon: HeartIcon, name: ["Shampoo"] }, - { icon: HeartIcon, name: ["Slippers"] }, - { icon: HeartIcon, name: ["Sofabed"] }, - { icon: HeartIcon, name: ["Sofas"] }, - { icon: HeartIcon, name: ["SofaWithTable"] }, - { icon: HeartIcon, name: ["SpaciousRoom"] }, - { icon: HeartIcon, name: ["StillAndSparklingWater"] }, - { icon: HeartIcon, name: ["Table"] }, - { icon: HeartIcon, name: ["TassimoCoffeeMaker"] }, - { icon: HeartIcon, name: ["Terrace"] }, - { icon: HeartIcon, name: ["TrouserPress"] }, - { icon: HeartIcon, name: ["TV"] }, - { icon: HeartIcon, name: ["TVWithComplimentaryMovieChannels"] }, - { icon: HeartIcon, name: ["TVWithMovieChannels"] }, - { icon: HeartIcon, name: ["TVWithStreamingOption"] }, - { icon: HeartIcon, name: ["VentilationInRoom"] }, - { icon: HeartIcon, name: ["View"] }, - { icon: HeartIcon, name: ["ViewFjordView"] }, - { icon: HeartIcon, name: ["ViewLakeView"] }, - { icon: HeartIcon, name: ["ViewPanoramicView"] }, - { icon: HeartIcon, name: ["ViewSeaView"] }, - { icon: HeartIcon, name: ["WallBed"] }, - { icon: HeartIcon, name: ["WallMountedCycleRack"] }, - { icon: HeartIcon, name: ["Wardrobe"] }, - { icon: HeartIcon, name: ["WellnessAndSaunaEntranceFeeAdmission16Years"] }, - { icon: HeartIcon, name: ["WellnessPoolSaunaEntranceFeeAdmission16Years"] }, - { icon: HeartIcon, name: ["WindowNook"] }, - { icon: IronIcon, name: ["IronAndIroningBoard"] }, - { icon: IronIcon, name: ["IroningRoom"] }, - { icon: KayakingIcon, name: ["KayaksForLoan"] }, - { icon: KettleIcon, name: ["Kettle"] }, - { icon: KettleIcon, name: ["KettleWithCoffeeTea"] }, - { icon: LaptopIcon, name: ["LaptopSafe"] }, - { icon: LaptopIcon, name: ["LaptopTray"] }, - { icon: LaundryMachineIcon, name: ["LaundryService"] }, - { icon: LocalBarIcon, name: ["Bar"] }, - { icon: LocalBarIcon, name: ["RooftopBar"] }, - { icon: LocalBarIcon, name: ["Skybar"] }, - { icon: LuggageIcon, name: ["LuggageLockers"] }, - { icon: MicrowaveIcon, name: ["Microwave"] }, - { icon: MirrorIcon, name: ["CosmeticMirror"] }, - { icon: NatureIcon, name: ["ViewParkView"] }, - { icon: NightlifeIcon, name: ["DiscoNightClub"] }, - { icon: NoSmokingIcon, name: ["NonSmoking"] }, - { icon: OutdoorFurnitureIcon, name: ["OutdoorTerrace"] }, - { icon: ParkingIcon, name: ["Parking"] }, - { icon: ParkingIcon, name: ["ParkingFreeParking"] }, - { icon: PetsIcon, name: ["PetFriendlyRooms"] }, - { icon: PhoneIcon, name: ["DirectDialPhoneAndVoiceMail"] }, - { icon: RestaurantIcon, name: ["Restaurant"] }, - { icon: RoomServiceIcon, name: ["Roomservice"] }, - { icon: SafetyBoxIcon, name: ["SafetyBox"] }, - { icon: SaunaIcon, name: ["Sauna"] }, - { icon: ShowerIcon, name: ["BathroomWithShower"] }, - { icon: ShowerIcon, name: ["RainShower"] }, - { icon: ShowerIcon, name: ["SharedBathroomWithShower"] }, - { icon: ShowerIcon, name: ["ShowerGel"] }, - { icon: ShowerIcon, name: ["ShowerProductsScentByGrandCentral"] }, - { icon: SpeakerIcon, name: ["ModernVinylplayer"] }, - { icon: SpeakerIcon, name: ["MusicPlayer"] }, - { icon: StoreIcon, name: ["Hairdresser"] }, - { icon: StoreIcon, name: ["Shop"] }, - { icon: StreetIcon, name: ["ViewStreetView"] }, - { icon: SwimIcon, name: ["Pool"] }, - { icon: TshirtWashIcon, name: ["HandWash"] }, - { icon: TvCastingIcon, name: ["TVWithChromecast"] }, - { icon: WifiIcon, name: ["FreeWifi"] }, - { icon: WindowCurtainsAltIcon, name: ["BlackoutCurtains"] }, - { icon: WindowNotAvailableIcon, name: ["NoWindow"] }, - { icon: WineBarIcon, name: ["Minibar"] }, - { icon: WoodFloorIcon, name: ["WoodenFloor"] }, - { icon: YardIcon, name: ["ViewAtriumView"] }, + { icon: AcIcon, name: "aircondition" }, + { icon: AirplaneIcon, name: "airport" }, + { icon: BalconyIcon, name: "balcony" }, + { icon: BalconyIcon, name: "balconyorterrace" }, + { icon: BalconyIcon, name: "frenchbalcony" }, + { icon: BathtubIcon, name: "bathroomwithbathtub" }, + { icon: BathtubIcon, name: "bathroomwithshowerandbathtub" }, + { icon: BathtubIcon, name: "bathroomwithshowerorbathtub" }, + { icon: BedDoubleIcon, name: "adjustablebeds" }, + { icon: BedDoubleIcon, name: "setoftwopillows" }, + { icon: BedHotelIcon, name: "armchairbed" }, + { icon: BedHotelIcon, name: "pulloutbed" }, + { icon: BedroomParentIcon, name: "separatebedroom" }, + { icon: BedSingleIcon, name: "extrabed" }, + { icon: BikeIcon, name: "bikeforloan" }, + { icon: BreakfastIcon, name: "breakfast" }, + { icon: BreakfastIcon, name: "servesbreakfastalwaysincluded" }, + { icon: BusinessIcon, name: "meetingconferencefacilities" }, + { icon: BusinessIcon, name: "meetingrooms" }, + { icon: CableIcon, name: "internetwithcableintheroom" }, + { icon: ChairIcon, name: "armchair" }, + { icon: ChairIcon, name: "connectingrooms" }, + { icon: CityIcon, name: "viewcityview" }, + { icon: CoffeeAltIcon, name: "nespressomachine" }, + { icon: CoffeeIcon, name: "café" }, + { icon: CoffeeIcon, name: "coffee" }, + { icon: CoffeeMakerIcon, name: "coffeemachine" }, + { icon: ConciergeIcon, name: "lifestyleconcierge" }, + { icon: CoolIcon, name: "aircooling" }, + { icon: CoolIcon, name: "cooler" }, + { icon: CoolIcon, name: "coolingcabinet" }, + { icon: DeskIcon, name: "deskandchair" }, + { icon: DiningIcon, name: "diningarea" }, + { icon: DiningIcon, name: "tablefordining" }, + { icon: ElectricBikeIcon, name: "ebikeschargingstation" }, + { icon: FamilyIcon, name: "extrafamilyfriendly" }, + { icon: FitnessIcon, name: "gym" }, + { icon: FootstoolIcon, name: "footstool" }, + { icon: HairdryerIcon, name: "hairdryer" }, + { icon: HandSoapIcon, name: "toiletries" }, + { icon: HealthBeautyIcon, name: "beautysalon" }, + { icon: HeartIcon, name: "bathrobes" }, + { icon: HeartIcon, name: "bathroom2separatebathrooms" }, + { icon: HeartIcon, name: "bodycareproducts" }, + { icon: HeartIcon, name: "bodylotion" }, + { icon: HeartIcon, name: "bowling" }, + { icon: HeartIcon, name: "bunkbed" }, + { icon: HeartIcon, name: "bunkbed80x188cm" }, + { icon: HeartIcon, name: "carpetingwalltowallcarpet" }, + { icon: HeartIcon, name: "cashfree800pmtill0600am" }, + { icon: HeartIcon, name: "cashfreehotel" }, + { icon: HeartIcon, name: "coffeevoucher" }, + { icon: HeartIcon, name: "complimentarycoldrefreshments" }, + { icon: HeartIcon, name: "conditioner" }, + { icon: HeartIcon, name: "conventioncentre" }, + { icon: HeartIcon, name: "disabledparking" }, + { icon: HeartIcon, name: "dockingstationforipodipad" }, + { icon: HeartIcon, name: "dryingcabinet" }, + { icon: HeartIcon, name: "easyaccess" }, + { icon: HeartIcon, name: "garmentsteamer" }, + { icon: HeartIcon, name: "highfloor" }, + { icon: HeartIcon, name: "icemachine" }, + { icon: HeartIcon, name: "icemachinereception" }, + { icon: HeartIcon, name: "jaccuzzi" }, + { icon: HeartIcon, name: "jacuzzi" }, + { icon: HeartIcon, name: "kitchen" }, + { icon: HeartIcon, name: "kitchenette" }, + { icon: HeartIcon, name: "latecheckoutuntil1400guaranteed" }, + { icon: HeartIcon, name: "livemusicexhibitions" }, + { icon: HeartIcon, name: "massage" }, + { icon: HeartIcon, name: "meetingarea" }, + { icon: HeartIcon, name: "minibarincludedinroomrate" }, + { icon: HeartIcon, name: "overnightsecurity" }, + { icon: HeartIcon, name: "parkingadditionalcost" }, + { icon: HeartIcon, name: "privatesauna" }, + { icon: HeartIcon, name: "refrigerator" }, + { icon: HeartIcon, name: "seatingarea" }, + { icon: HeartIcon, name: "security24hoours" }, + { icon: HeartIcon, name: "separatelivingroom" }, + { icon: HeartIcon, name: "separatetoilet" }, + { icon: HeartIcon, name: "servicesecurity24h" }, + { icon: HeartIcon, name: "shampoo" }, + { icon: HeartIcon, name: "slippers" }, + { icon: HeartIcon, name: "sofabed" }, + { icon: HeartIcon, name: "sofas" }, + { icon: HeartIcon, name: "sofawithtable" }, + { icon: HeartIcon, name: "spaciousroom" }, + { icon: HeartIcon, name: "stillandsparklingwater" }, + { icon: HeartIcon, name: "table" }, + { icon: HeartIcon, name: "tassimocoffeemaker" }, + { icon: HeartIcon, name: "terrace" }, + { icon: HeartIcon, name: "trouserpress" }, + { icon: HeartIcon, name: "tv" }, + { icon: HeartIcon, name: "tvwithcomplimentarymoviechannels" }, + { icon: HeartIcon, name: "tvwithmoviechannels" }, + { icon: HeartIcon, name: "tvwithstreamingoption" }, + { icon: HeartIcon, name: "ventilationinroom" }, + { icon: HeartIcon, name: "view" }, + { icon: HeartIcon, name: "viewfjordview" }, + { icon: HeartIcon, name: "viewlakeview" }, + { icon: HeartIcon, name: "viewpanoramicview" }, + { icon: HeartIcon, name: "viewseaview" }, + { icon: HeartIcon, name: "wallbed" }, + { icon: HeartIcon, name: "wallmountedcyclerack" }, + { icon: HeartIcon, name: "wardrobe" }, + { icon: HeartIcon, name: "wellnessandsaunaentrancefeeadmission16years" }, + { icon: HeartIcon, name: "wellnesspoolsaunaentrancefeeadmission16years" }, + { icon: HeartIcon, name: "windownook" }, + { icon: IronIcon, name: "ironandironingboard" }, + { icon: IronIcon, name: "ironingroom" }, + { icon: KayakingIcon, name: "kayaksforloan" }, + { icon: KettleIcon, name: "kettle" }, + { icon: KettleIcon, name: "kettlewithcoffeetea" }, + { icon: LaptopIcon, name: "laptopsafe" }, + { icon: LaptopIcon, name: "laptoptray" }, + { icon: LaundryMachineIcon, name: "laundryservice" }, + { icon: LocalBarIcon, name: "bar" }, + { icon: LocalBarIcon, name: "rooftopbar" }, + { icon: LocalBarIcon, name: "skybar" }, + { icon: LuggageIcon, name: "luggagelockers" }, + { icon: MicrowaveIcon, name: "microwave" }, + { icon: MirrorIcon, name: "cosmeticmirror" }, + { icon: NatureIcon, name: "viewparkview" }, + { icon: NightlifeIcon, name: "disconightclub" }, + { icon: NoSmokingIcon, name: "nonsmoking" }, + { icon: OutdoorFurnitureIcon, name: "outdoorterrace" }, + { icon: ParkingIcon, name: "parking" }, + { icon: ParkingIcon, name: "parkingfreeparking" }, + { icon: PetsIcon, name: "petfriendlyrooms" }, + { icon: PhoneIcon, name: "directdialphoneandvoicemail" }, + { icon: RestaurantIcon, name: "restaurant" }, + { icon: RoomServiceIcon, name: "roomservice" }, + { icon: SafetyBoxIcon, name: "safetybox" }, + { icon: SaunaIcon, name: "sauna" }, + { icon: ShowerIcon, name: "bathroomwithshower" }, + { icon: ShowerIcon, name: "rainshower" }, + { icon: ShowerIcon, name: "sharedbathroomwithshower" }, + { icon: ShowerIcon, name: "showergel" }, + { icon: ShowerIcon, name: "showerproductsscentbygrandcentral" }, + { icon: SpeakerIcon, name: "modernvinylplayer" }, + { icon: SpeakerIcon, name: "musicplayer" }, + { icon: StoreIcon, name: "hairdresser" }, + { icon: StoreIcon, name: "shop" }, + { icon: StreetIcon, name: "viewstreetview" }, + { icon: SwimIcon, name: "pool" }, + { icon: TshirtWashIcon, name: "handwash" }, + { icon: TvCastingIcon, name: "tvwithchromecast" }, + { icon: WifiIcon, name: "freewifi" }, + { icon: WindowCurtainsAltIcon, name: "blackoutcurtains" }, + { icon: WindowNotAvailableIcon, name: "nowindow" }, + { icon: WineBarIcon, name: "minibar" }, + { icon: WoodFloorIcon, name: "woodenfloor" }, + { icon: YardIcon, name: "viewatriumview" }, ] - const icon = iconMappings.find((icon) => icon.name.includes(name)) + const icon = iconMappings.find( + (icon) => icon.name.toLowerCase() === normalizedName + ) + return icon ? icon.icon : HeartIcon }