feat(SW-938) use mapFacilityToIcon
This commit is contained in:
@@ -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<IconProps> | 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
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
|
import { mapFacilityToIcon } from "@/components/ContentType/HotelPage/data"
|
||||||
import Contact from "@/components/HotelReservation/Contact"
|
import Contact from "@/components/HotelReservation/Contact"
|
||||||
import { AccessibilityIcon } from "@/components/Icons"
|
import { AccessibilityIcon } from "@/components/Icons"
|
||||||
import Accordion from "@/components/TempDesignSystem/Accordion"
|
import Accordion from "@/components/TempDesignSystem/Accordion"
|
||||||
@@ -9,8 +10,6 @@ import SidePeek from "@/components/TempDesignSystem/SidePeek"
|
|||||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||||
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||||
|
|
||||||
import { getHotelFacilityIcon } from "./hotelFacilityIcon"
|
|
||||||
|
|
||||||
import styles from "./hotelSidePeek.module.css"
|
import styles from "./hotelSidePeek.module.css"
|
||||||
|
|
||||||
import type { HotelSidePeekProps } from "@/types/components/hotelReservation/hotelSidePeek"
|
import type { HotelSidePeekProps } from "@/types/components/hotelReservation/hotelSidePeek"
|
||||||
@@ -68,7 +67,7 @@ export default function HotelSidePeek({
|
|||||||
{intl.formatMessage({ id: "Accessibility" })}
|
{intl.formatMessage({ id: "Accessibility" })}
|
||||||
</div>
|
</div>
|
||||||
{amenitiesList.map((amenity) => {
|
{amenitiesList.map((amenity) => {
|
||||||
const Icon = getHotelFacilityIcon(amenity.icon)
|
const Icon = mapFacilityToIcon(amenity.id)
|
||||||
return (
|
return (
|
||||||
<div key={amenity.id} className={styles.amenity}>
|
<div key={amenity.id} className={styles.amenity}>
|
||||||
{Icon && (
|
{Icon && (
|
||||||
|
|||||||
Reference in New Issue
Block a user