feat(SW-302): switch out mock data for facility cards

This commit is contained in:
Matilda Landström
2024-09-17 15:17:15 +02:00
parent 8d5ed30fc4
commit 86dd3c04ed
22 changed files with 289 additions and 16938 deletions

View File

@@ -1,13 +1,13 @@
.one {
.spanOne {
grid-column: span 1;
}
.two {
.spanTwo {
grid-column: span 2;
}
.three {
grid-column: 1/-1;
.spanThree {
grid-column: span 3;
}
.desktopGrid {
@@ -23,6 +23,8 @@
.desktopGrid {
display: grid;
gap: var(--Spacing-x1);
grid-template-columns: repeat(3, 1fr);
grid-auto-flow: dense;
}
.mobileGrid {

View File

@@ -9,6 +9,8 @@ import type { CardGridProps } from "@/types/components/hotelPage/facilities"
export default async function CardGrid({ facility }: CardGridProps) {
const imageCard = sortCards(facility)
const nrCards = facility.length
return (
<section id={imageCard.card?.id}>
<Grids.Stackable className={styles.desktopGrid}>
@@ -22,7 +24,13 @@ export default async function CardGrid({ facility }: CardGridProps) {
secondaryButton={card.secondaryButton}
primaryButton={card.primaryButton}
backgroundImage={card.backgroundImage}
className={styles[card.columnSpan]}
className={
nrCards == 1
? styles.spanThree
: nrCards == 2 && card.backgroundImage
? styles.spanTwo
: styles.spanOne
}
/>
))}
</Grids.Stackable>

File diff suppressed because it is too large Load Diff

View File

@@ -1,144 +0,0 @@
import {
activities,
meetingsAndConferences,
restaurantAndBar,
wellnessAndExercise,
} from "@/constants/routes/hotelPageParams"
import { getLang } from "@/i18n/serverContext"
import type { Facilities } from "@/types/components/hotelPage/facilities"
const lang = getLang()
/*
Most of this will be available from the api. Some will need to come from Contentstack. "Activities" will most likely come from Contentstack, which is prepped for.
*/
export const MOCK_FACILITIES: Facilities = [
[
{
id: "restaurant-and-bar",
theme: "primaryDark",
scriptedTopTitle: "Restaurant & Bar",
heading: "Enjoy relaxed restaurant experience",
secondaryButton: {
href: `?s=${restaurantAndBar[lang]}`,
title: "Read more & book a table",
isExternal: false,
},
columnSpan: "one",
},
{
backgroundImage: {
url: "https://imagevault.scandichotels.com/publishedmedia/79xttlmnum0kjbwhyh18/scandic-helsinki-hub-restaurant-food-tuna.jpg",
title: "scandic-helsinki-hub-restaurant-food-tuna.jpg",
meta: {
alt: "food in restaurant at scandic helsinki hub",
caption: "food in restaurant at scandic helsinki hub",
},
id: 81751,
dimensions: {
width: 5935,
height: 3957,
aspectRatio: 1.499873641647713,
},
},
columnSpan: "one",
},
{
backgroundImage: {
url: "https://imagevault.scandichotels.com/publishedmedia/48sb3eyhhzj727l2j1af/Scandic-helsinki-hub-II-centro-41.jpg",
meta: {
alt: "restaurant il centro at scandic helsinki hu",
caption: "restaurant il centro at scandic helsinki hub",
},
id: 82457,
title: "Scandic-helsinki-hub-II-centro-41.jpg",
dimensions: {
width: 4200,
height: 2800,
aspectRatio: 1.5,
},
},
columnSpan: "one",
},
],
[
{
backgroundImage: {
url: "https://imagevault.scandichotels.com/publishedmedia/csef06n329hjfiet1avj/Scandic-spectrum-8.jpg",
meta: {
alt: "man with a laptop",
caption: "man with a laptop",
},
id: 82713,
title: "Scandic-spectrum-8.jpg",
dimensions: {
width: 7499,
height: 4999,
aspectRatio: 1.500100020004001,
},
},
columnSpan: "two",
},
{
id: "meetings-and-conferences",
theme: "primaryDim",
scriptedTopTitle: "Meetings & Conferences",
heading: "Events that make an impression",
secondaryButton: {
href: `?s=${meetingsAndConferences[lang]}`,
title: "About meetings & conferences",
isExternal: false,
},
columnSpan: "one",
},
],
[
{
id: "wellness-and-exercise",
theme: "one",
scriptedTopTitle: "Wellness & Exercise",
heading: "Sauna and gym",
secondaryButton: {
href: `?s=${wellnessAndExercise[lang]}`,
title: "Read more about wellness & exercise",
isExternal: false,
},
columnSpan: "one",
},
{
backgroundImage: {
url: "https://imagevault.scandichotels.com/publishedmedia/69acct5i3pk5be7d6ub0/scandic-helsinki-hub-sauna.jpg",
meta: {
alt: "sauna at scandic helsinki hub",
caption: "sauna at scandic helsinki hub",
},
id: 81814,
title: "scandic-helsinki-hub-sauna.jpg",
dimensions: {
width: 4000,
height: 2667,
aspectRatio: 1.4998125234345707,
},
},
columnSpan: "one",
},
{
backgroundImage: {
url: "https://imagevault.scandichotels.com/publishedmedia/eu70o6z85idy24r92ysf/Scandic-Helsinki-Hub-gym-22.jpg",
meta: {
alt: "Gym at hotel Scandic Helsinki Hub",
caption: "Gym at hotel Scandic Helsinki Hub",
},
id: 81867,
title: "Scandic-Helsinki-Hub-gym-22.jpg",
dimensions: {
width: 4000,
height: 2667,
aspectRatio: 1.4998125234345707,
},
},
columnSpan: "one",
},
],
]

View File

@@ -10,7 +10,7 @@ import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
import styles from "./roomCard.module.css"
import { RoomCardProps } from "@/types/components/hotelPage/roomCard"
import type { RoomCardProps } from "@/types/components/hotelPage/roomCard"
export function RoomCard({
badgeTextTransKey,

View File

@@ -10,10 +10,11 @@ import Button from "@/components/TempDesignSystem/Button"
import Grids from "@/components/TempDesignSystem/Grids"
import { RoomCard } from "./RoomCard"
import { RoomsProps } from "./types"
import styles from "./rooms.module.css"
import type { RoomsProps } from "./types"
export function Rooms({ rooms }: RoomsProps) {
const intl = useIntl()
const [allRoomsVisible, setAllRoomsVisible] = useState(false)

View File

@@ -7,8 +7,7 @@ import SidePeek from "@/components/TempDesignSystem/SidePeek"
import { getIntl } from "@/i18n"
import { getLang } from "@/i18n/serverContext"
import { MOCK_FACILITIES } from "./Facilities/mockData"
import { setActivityCard } from "./Facilities/utils"
import { setActivityCard, setFacilityCards } from "@/utils/facilityCards"
import DynamicMap from "./Map/DynamicMap"
import MapCard from "./Map/MapCard"
import MobileMapToggle from "./Map/MobileMapToggle"
@@ -45,9 +44,10 @@ export default async function HotelPage() {
roomCategories,
activitiesCard,
pointsOfInterest,
facilityCards,
} = hotelData
const facilities = [...MOCK_FACILITIES]
const facilities = await setFacilityCards(facilityCards)
activitiesCard && facilities.push(setActivityCard(activitiesCard))
const topThreePois = pointsOfInterest.slice(0, 3)