Merged in feature/refactor-lang (pull request #387)

feat: SW-238 Avoid prop drilling of lang

Approved-by: Michael Zetterberg
This commit is contained in:
Niclas Edenvin
2024-08-14 11:00:20 +00:00
parent 35128dbf44
commit e67212bd94
94 changed files with 378 additions and 322 deletions
@@ -1,5 +1,7 @@
import { serverClient } from "@/lib/trpc/server"
import { getLang } from "@/i18n/serverContext"
import AmenitiesList from "./AmenitiesList"
import IntroSection from "./IntroSection"
import { Rooms } from "./Rooms"
@@ -7,9 +9,7 @@ import TabNavigation from "./TabNavigation"
import styles from "./hotelPage.module.css"
import type { LangParams } from "@/types/params"
export default async function HotelPage({ lang }: LangParams) {
export default async function HotelPage() {
const hotelPageIdentifierData =
await serverClient().contentstack.hotelPage.get()
@@ -19,7 +19,7 @@ export default async function HotelPage({ lang }: LangParams) {
const { attributes, roomCategories } = await serverClient().hotel.getHotel({
hotelId: hotelPageIdentifierData.hotel_page_id,
language: lang,
language: getLang(),
include: ["RoomCategories"],
})