feat(SW-237): Implemented page based toggle for BW

This commit is contained in:
Hrishikesh Vaipurkar
2024-08-19 16:28:47 +02:00
parent 25f2e8f360
commit 0abaa4dc19
10 changed files with 61 additions and 33 deletions

View File

@@ -1,8 +1,6 @@
import { homeHrefs } from "@/constants/homeHrefs"
import { env } from "@/env/server"
import { serverClient } from "@/lib/trpc/server"
import { BookingWidget } from "@/components/BookingWidget"
import { getLang } from "@/i18n/serverContext"
import { MainMenu } from "./MainMenu"
@@ -24,12 +22,6 @@ export default async function Header({
const user = await serverClient().user.name()
// 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
}
@@ -61,9 +53,6 @@ export default async function Header({
bookingHref={homeHref}
user={user}
/>
{bookingWidgetToggle && bookingWidgetToggle.hideBookingWidget ? null : (
<BookingWidget />
)}
</header>
)
}