feat(SW-914): add enum
This commit is contained in:
@@ -37,7 +37,7 @@ export default async function AboutTheHotelSidePeek({
|
||||
socials={socials}
|
||||
ecoLabels={ecoLabels}
|
||||
/>
|
||||
<Divider color="baseSurfaceSutbleHover" />
|
||||
<Divider color="baseSurfaceSubtleHover" />
|
||||
<Preamble>{descriptions.descriptions.medium}</Preamble>
|
||||
<Body>{descriptions.facilityInformation}</Body>
|
||||
</section>
|
||||
|
||||
@@ -3,7 +3,10 @@ import { getIntl } from "@/i18n"
|
||||
|
||||
import styles from "./parkingPrices.module.css"
|
||||
|
||||
import type { ParkingPricesProps } from "@/types/components/hotelPage/sidepeek/parking"
|
||||
import {
|
||||
type ParkingPricesProps,
|
||||
Periods,
|
||||
} from "@/types/components/hotelPage/sidepeek/parking"
|
||||
|
||||
export default async function ParkingPrices({
|
||||
data,
|
||||
@@ -17,20 +20,22 @@ export default async function ParkingPrices({
|
||||
|
||||
function getPeriod(period: string | undefined) {
|
||||
switch (period) {
|
||||
case "Day":
|
||||
case Periods.day:
|
||||
return day
|
||||
case "Night":
|
||||
case Periods.night:
|
||||
return night
|
||||
case "AllDay":
|
||||
case Periods.allDay:
|
||||
return allDay
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
const filterdPeriods = data?.filter((filter) => filter.period !== "Hour")
|
||||
const filteredPeriods = data?.filter((filter) => filter.period !== "Hour")
|
||||
|
||||
return (
|
||||
<div className={styles.wrapper}>
|
||||
{filterdPeriods?.map((parking) => (
|
||||
{filteredPeriods?.map((parking) => (
|
||||
<div key={parking.period} className={styles.period}>
|
||||
<div className={styles.information}>
|
||||
<Body textTransform="bold" color="uiTextHighContrast">
|
||||
@@ -44,7 +49,7 @@ export default async function ParkingPrices({
|
||||
</div>
|
||||
{parking.startTime &&
|
||||
parking.endTime &&
|
||||
parking.period !== "AllDay" && (
|
||||
parking.period !== Periods.allDay && (
|
||||
<div className={styles.information}>
|
||||
<Body color="uiTextHighContrast">
|
||||
{intl.formatMessage({ id: "From" })}
|
||||
|
||||
@@ -27,7 +27,7 @@ export default async function ParkingAmenity({ parking }: ParkingAmenityProps) {
|
||||
<Body color="uiTextHighContrast" asChild>
|
||||
<ul className={styles.listStyling}>
|
||||
{data.numberOfChargingSpaces ? (
|
||||
<li>{`Number of charging points for electric cars: ${data.numberOfChargingSpaces}`}</li>
|
||||
<li>{`${intl.formatMessage({ id: "Number of charging points for electric cars" })}: ${data.numberOfChargingSpaces}`}</li>
|
||||
) : null}
|
||||
<li>{`${intl.formatMessage({ id: "Parking can be reserved in advance" })}: ${data.canMakeReservation ? intl.formatMessage({ id: "Yes" }) : intl.formatMessage({ id: "No" })}`}</li>
|
||||
{data.numberOfParkingSpots ? (
|
||||
@@ -50,7 +50,7 @@ export default async function ParkingAmenity({ parking }: ParkingAmenityProps) {
|
||||
<Caption color="uiTextMediumContrast" textTransform="uppercase">
|
||||
{intl.formatMessage({ id: "Weekday prices" })}
|
||||
</Caption>
|
||||
<Divider color="baseSurfaceSutbleHover" />
|
||||
<Divider color="baseSurfaceSubtleHover" />
|
||||
<ParkingPrices
|
||||
data={data.pricing.localCurrency.ordinary}
|
||||
currency={data.pricing.localCurrency.currency}
|
||||
@@ -61,7 +61,7 @@ export default async function ParkingAmenity({ parking }: ParkingAmenityProps) {
|
||||
<Caption color="uiTextMediumContrast" textTransform="uppercase">
|
||||
{intl.formatMessage({ id: "Weekend prices" })}
|
||||
</Caption>
|
||||
<Divider color="baseSurfaceSutbleHover" />
|
||||
<Divider color="baseSurfaceSubtleHover" />
|
||||
<ParkingPrices
|
||||
data={data.pricing.localCurrency.weekend}
|
||||
currency={data.pricing.localCurrency.currency}
|
||||
|
||||
@@ -14,6 +14,7 @@ const facilityToIconMap: Record<FacilityEnum, IconName> = {
|
||||
[FacilityEnum.GymTrainingFacilities]: IconName.Fitness,
|
||||
[FacilityEnum.KeyAccessOnlyToHealthClubGym]: IconName.Fitness,
|
||||
[FacilityEnum.FreeWiFi]: IconName.Wifi,
|
||||
[FacilityEnum.MeetingArea]: IconName.Business,
|
||||
[FacilityEnum.MeetingRooms]: IconName.Business,
|
||||
[FacilityEnum.MeetingConferenceFacilities]: IconName.Business,
|
||||
[FacilityEnum.PetFriendlyRooms]: IconName.Pets,
|
||||
@@ -27,6 +28,7 @@ const facilityToIconMap: Record<FacilityEnum, IconName> = {
|
||||
[FacilityEnum.DisabledParking]: IconName.Parking,
|
||||
[FacilityEnum.OutdoorTerrace]: IconName.OutdoorFurniture,
|
||||
[FacilityEnum.RoomService]: IconName.RoomService,
|
||||
[FacilityEnum.LateCheckOutUntil1400Guaranteed]: IconName.Business,
|
||||
[FacilityEnum.LaundryRoom]: IconName.LaundryMachine,
|
||||
[FacilityEnum.LaundryService]: IconName.LaundryMachine,
|
||||
[FacilityEnum.LaundryServiceExpress]: IconName.LaundryMachine,
|
||||
@@ -281,8 +283,6 @@ const facilityToIconMap: Record<FacilityEnum, IconName> = {
|
||||
[FacilityEnum.WideEntrance]: IconName.StarFilled,
|
||||
[FacilityEnum.WideRestaurantEntrance]: IconName.StarFilled,
|
||||
[FacilityEnum.WiFiWirelessInternetAccessAllScandic]: IconName.StarFilled,
|
||||
[FacilityEnum.MeetingArea]: IconName.Business,
|
||||
[FacilityEnum.LateCheckOutUntil1400Guaranteed]: IconName.Business,
|
||||
}
|
||||
|
||||
export function mapFacilityToIcon(id: FacilityEnum): FC<IconProps> | null {
|
||||
|
||||
@@ -13,7 +13,7 @@ export const dividerVariants = cva(styles.divider, {
|
||||
primaryLightSubtle: styles.primaryLightSubtle,
|
||||
subtle: styles.subtle,
|
||||
white: styles.white,
|
||||
baseSurfaceSutbleHover: styles.baseSurfaceSubtleHover,
|
||||
baseSurfaceSubtleHover: styles.baseSurfaceSubtleHover,
|
||||
},
|
||||
opacity: {
|
||||
100: styles.opacity100,
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
import type { Hotel } from "@/types/hotel"
|
||||
|
||||
export enum Periods {
|
||||
day = "Day",
|
||||
night = "Night",
|
||||
allDay = "AllDay",
|
||||
}
|
||||
|
||||
export type ParkingAmenityProps = {
|
||||
parking: Hotel["parking"]
|
||||
}
|
||||
|
||||
@@ -148,6 +148,7 @@ export enum FacilityEnum {
|
||||
Lake0To1Km = 1865,
|
||||
LakeOrSea0To1Km = 245437,
|
||||
LaptopSafe = 5283,
|
||||
LateCheckOutUntil1400Guaranteed = 324101,
|
||||
LaundryRoom = 326031,
|
||||
LaundryService = 1834,
|
||||
LaundryServiceExpress = 162583,
|
||||
@@ -155,6 +156,7 @@ export enum FacilityEnum {
|
||||
LifestyleConcierge = 162584,
|
||||
LuggageLockers = 324098,
|
||||
Massage = 348859,
|
||||
MeetingArea = 1692,
|
||||
MeetingConferenceFacilities = 5806,
|
||||
MeetingRooms = 1017,
|
||||
MinibarInRoom = 5768,
|
||||
@@ -259,6 +261,4 @@ export enum FacilityEnum {
|
||||
WideEntrance = 2085,
|
||||
WideRestaurantEntrance = 2087,
|
||||
WiFiWirelessInternetAccessAllScandic = 5774,
|
||||
MeetingArea = 1692,
|
||||
LateCheckOutUntil1400Guaranteed = 324101,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user