Merged in feat/SW-682-hotel-page-update-navigation-headers (pull request #1193)
feat/SW-682-hotel-page-update-navigation-headers * feat(SW-682): fetch tab values * feat(SW-682): change key name Approved-by: Erik Tiekstra Approved-by: Matilda Landström
This commit is contained in:
@@ -23,6 +23,7 @@ export default function TabNavigation({
|
||||
restaurantTitle,
|
||||
hasActivities,
|
||||
hasFAQ,
|
||||
tabValues,
|
||||
}: TabNavigationProps) {
|
||||
const hash = useHash()
|
||||
const intl = useIntl()
|
||||
@@ -37,29 +38,36 @@ export default function TabNavigation({
|
||||
const tabLinks: { hash: HotelHashValues; text: string }[] = [
|
||||
{
|
||||
hash: HotelHashValues.overview,
|
||||
text: intl.formatMessage({ id: "Overview" }),
|
||||
text: tabValues?.overview || intl.formatMessage({ id: "Overview" }),
|
||||
},
|
||||
{
|
||||
hash: HotelHashValues.rooms,
|
||||
text: intl.formatMessage({ id: "Rooms" }),
|
||||
text: tabValues?.rooms || intl.formatMessage({ id: "Rooms" }),
|
||||
},
|
||||
{
|
||||
hash: HotelHashValues.restaurant,
|
||||
text: intl.formatMessage({ id: restaurantTitle }, { count: 1 }),
|
||||
text:
|
||||
tabValues?.restaurant_bar ||
|
||||
intl.formatMessage({ id: restaurantTitle }, { count: 1 }),
|
||||
},
|
||||
{
|
||||
hash: HotelHashValues.meetings,
|
||||
text: intl.formatMessage({ id: "Meetings & Conferences" }),
|
||||
text:
|
||||
tabValues?.conferences_meetings ||
|
||||
intl.formatMessage({ id: "Meetings & Conferences" }),
|
||||
},
|
||||
{
|
||||
hash: HotelHashValues.wellness,
|
||||
text: intl.formatMessage({ id: "Wellness & Exercise" }),
|
||||
text:
|
||||
tabValues?.health_wellness ||
|
||||
intl.formatMessage({ id: "Wellness & Exercise" }),
|
||||
},
|
||||
...(hasActivities
|
||||
? [
|
||||
{
|
||||
hash: HotelHashValues.activities,
|
||||
text: intl.formatMessage({ id: "Activities" }),
|
||||
text:
|
||||
tabValues?.activities || intl.formatMessage({ id: "Activities" }),
|
||||
},
|
||||
]
|
||||
: []),
|
||||
@@ -67,7 +75,7 @@ export default function TabNavigation({
|
||||
? [
|
||||
{
|
||||
hash: HotelHashValues.faq,
|
||||
text: intl.formatMessage({ id: "FAQ" }),
|
||||
text: tabValues?.faq || intl.formatMessage({ id: "FAQ" }),
|
||||
},
|
||||
]
|
||||
: []),
|
||||
|
||||
@@ -58,7 +58,7 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
|
||||
}
|
||||
|
||||
const jsonSchema = generateHotelSchema(hotelData.data.attributes)
|
||||
const { faq, content } = hotelPageData
|
||||
const { faq, content, tabValues } = hotelPageData
|
||||
const {
|
||||
name,
|
||||
address,
|
||||
@@ -142,6 +142,7 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
|
||||
restaurantTitle={getRestaurantHeading(detailedFacilities)}
|
||||
hasActivities={activitiesCards.length > 0}
|
||||
hasFAQ={!!faq.accordions.length}
|
||||
tabValues={tabValues}
|
||||
/>
|
||||
|
||||
<main className={styles.mainSection}>
|
||||
|
||||
Reference in New Issue
Block a user