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