feat(SW-914): add accordion components
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
export default function AccessibilityAmenity() {
|
||||||
|
return <div>AccessibilityAmenity</div>
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export default function BreakfastAmenity() {
|
||||||
|
return <div>BreakfastAmenity</div>
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import React from "react"
|
||||||
|
|
||||||
|
export default function CheckInCheckOutAmenity() {
|
||||||
|
return <div>CheckInAmenity</div>
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export default function MeetingsAmenity() {
|
||||||
|
return <div>MeetingsAmenity</div>
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export default function ParkingAmenity() {
|
||||||
|
return <div>ParkingAmenity</div>
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
export { default as AccessibilityAmenity } from "./Accessibility"
|
||||||
|
export { default as BreakfastAmenity } from "./Breakfast"
|
||||||
|
export { default as CheckInCheckOutAmenity } from "./CheckInCheckOut"
|
||||||
|
export { default as MeetingsAmenity } from "./Meetings"
|
||||||
|
export { default as ParkingAmenity } from "./Parking"
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
.wrapper {
|
||||||
|
padding: var(--Spacing-x1);
|
||||||
|
border-bottom: 1px solid var(--Base-Border-Subtle);
|
||||||
|
}
|
||||||
|
|
||||||
|
.amenity {
|
||||||
|
display: flex;
|
||||||
|
gap: var(--Spacing-x1);
|
||||||
|
padding: var(--Spacing-x-one-and-half) var(--Spacing-x2);
|
||||||
|
}
|
||||||
@@ -1,13 +1,23 @@
|
|||||||
import { amenities } from "@/constants/routes/hotelPageParams"
|
import { amenities } from "@/constants/routes/hotelPageParams"
|
||||||
|
|
||||||
|
import { HeartIcon } from "@/components/Icons"
|
||||||
import Accordion from "@/components/TempDesignSystem/Accordion"
|
import Accordion from "@/components/TempDesignSystem/Accordion"
|
||||||
import AccordionItem from "@/components/TempDesignSystem/Accordion/AccordionItem"
|
import AccordionItem from "@/components/TempDesignSystem/Accordion/AccordionItem"
|
||||||
import SidePeek from "@/components/TempDesignSystem/SidePeek"
|
import SidePeek from "@/components/TempDesignSystem/SidePeek"
|
||||||
|
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||||
import { getIntl } from "@/i18n"
|
import { getIntl } from "@/i18n"
|
||||||
import { getLang } from "@/i18n/serverContext"
|
import { getLang } from "@/i18n/serverContext"
|
||||||
|
|
||||||
import { mapFacilityToIconName } from "../../data"
|
import { mapFacilityToIcon } from "../../data"
|
||||||
import Amenity from "./Amenity"
|
import {
|
||||||
|
AccessibilityAmenity,
|
||||||
|
BreakfastAmenity,
|
||||||
|
CheckInCheckOutAmenity,
|
||||||
|
MeetingsAmenity,
|
||||||
|
ParkingAmenity,
|
||||||
|
} from "./AccordionAmenities"
|
||||||
|
|
||||||
|
import styles from "./amenities.module.css"
|
||||||
|
|
||||||
import type { AmenitiesSidePeekProps } from "@/types/components/hotelPage/sidepeek/amenities"
|
import type { AmenitiesSidePeekProps } from "@/types/components/hotelPage/sidepeek/amenities"
|
||||||
import { IconName } from "@/types/components/icon"
|
import { IconName } from "@/types/components/icon"
|
||||||
@@ -17,22 +27,61 @@ export default async function AmenitiesSidePeek({
|
|||||||
}: AmenitiesSidePeekProps) {
|
}: AmenitiesSidePeekProps) {
|
||||||
const lang = getLang()
|
const lang = getLang()
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
|
|
||||||
|
const filterdList = amenitiesList
|
||||||
|
.filter((filter) => !filter.name.startsWith("Parking"))
|
||||||
|
.filter((filter) => !filter.name.startsWith("Meeting"))
|
||||||
|
.filter((filter) => filter.name !== "Late check-out until 14:00 guaranteed")
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SidePeek
|
<SidePeek
|
||||||
contentKey={amenities[lang]}
|
contentKey={amenities[lang]}
|
||||||
title={intl.formatMessage({ id: "Amenities" })}
|
title={intl.formatMessage({ id: "Amenities" })}
|
||||||
>
|
>
|
||||||
<Accordion>
|
<Accordion>
|
||||||
{amenitiesList.map((amenity) => {
|
<AccordionItem
|
||||||
const name = mapFacilityToIconName(amenity.id)
|
title={intl.formatMessage({ id: "Parking" })}
|
||||||
|
icon={IconName.Parking}
|
||||||
|
>
|
||||||
|
<ParkingAmenity />
|
||||||
|
</AccordionItem>
|
||||||
|
<AccordionItem
|
||||||
|
title={intl.formatMessage({ id: "Breakfast" })}
|
||||||
|
icon={IconName.CoffeeAlt}
|
||||||
|
>
|
||||||
|
<BreakfastAmenity />
|
||||||
|
</AccordionItem>
|
||||||
|
<AccordionItem
|
||||||
|
title={`${intl.formatMessage({ id: "Check-in" })}/${intl.formatMessage({ id: "Check-out" })}`}
|
||||||
|
icon={IconName.Business}
|
||||||
|
>
|
||||||
|
<CheckInCheckOutAmenity />
|
||||||
|
</AccordionItem>
|
||||||
|
<AccordionItem
|
||||||
|
title={intl.formatMessage({ id: "Accessibility" })}
|
||||||
|
icon={IconName.Accessibility}
|
||||||
|
>
|
||||||
|
<AccessibilityAmenity />
|
||||||
|
</AccordionItem>
|
||||||
|
<AccordionItem
|
||||||
|
title={intl.formatMessage({ id: "Meetings & Conferences" })}
|
||||||
|
icon={IconName.Business}
|
||||||
|
>
|
||||||
|
<MeetingsAmenity />
|
||||||
|
</AccordionItem>
|
||||||
|
{filterdList.map((amenity) => {
|
||||||
|
const Icon = mapFacilityToIcon(amenity.id)
|
||||||
return (
|
return (
|
||||||
<AccordionItem
|
<div key={amenity.name} className={styles.wrapper}>
|
||||||
key={amenity.name}
|
<div className={styles.amenity}>
|
||||||
title={amenity.name}
|
{Icon ? (
|
||||||
icon={IconName[name]}
|
<Icon color="burgundy" width={24} height={24} />
|
||||||
>
|
) : (
|
||||||
<Amenity name={amenity.name} />
|
<HeartIcon color="burgundy" width={24} height={24} />
|
||||||
</AccordionItem>
|
)}
|
||||||
|
<Body color="burgundy">{amenity.name}</Body>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
|||||||
Reference in New Issue
Block a user