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

@@ -0,0 +1,23 @@
import { serverClient } from "@/lib/trpc/server"
import { getLang } from "@/i18n/serverContext"
import Form from "@/components/Forms/BookingWidget"
import styles from "./bookingWidget.module.css"
export default async function BookingWidgetContainer() {
// Get the booking widget show/hide status based on page specific settings
const bookingWidgetToggle =
await serverClient().contentstack.base.page_settings({
lang: getLang(),
})
return (
<>
{bookingWidgetToggle && bookingWidgetToggle.hideBookingWidget ? null : (
<section className={styles.container}>
<Form />
</section>
)}
</>
)
}