feat(SW-237): Implemented hide booking widget page level flag

This commit is contained in:
Hrishikesh Vaipurkar
2024-08-07 22:45:05 +02:00
parent 84985737b6
commit 25f2e8f360
3 changed files with 108 additions and 5 deletions

View File

@@ -24,10 +24,11 @@ export default async function Header({
const user = await serverClient().user.name()
/**
* ToDo: Create logic to get this info from ContentStack based on page
* */
const hideBookingWidget = true
// Get the booking widget show/hide status based on page specific settings
const bookingWidgetToggle =
await serverClient().contentstack.base.page_settings({
lang: getLang(),
})
if (!data) {
return null
@@ -60,7 +61,9 @@ export default async function Header({
bookingHref={homeHref}
user={user}
/>
{hideBookingWidget ? null : <BookingWidget />}
{bookingWidgetToggle && bookingWidgetToggle.hideBookingWidget ? null : (
<BookingWidget />
)}
</header>
)
}