feat: add env var for signup flow
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { headers } from "next/headers"
|
||||
import { notFound } from "next/navigation"
|
||||
|
||||
import { isSignupPage } from "@/constants/routes/signup"
|
||||
import { env } from "@/env/server"
|
||||
|
||||
import HotelPage from "@/components/ContentType/HotelPage"
|
||||
@@ -22,17 +24,24 @@ export default function ContentTypePage({
|
||||
}: PageArgs<LangParams & ContentTypeParams & UIDParams, {}>) {
|
||||
setLang(params.lang)
|
||||
|
||||
const pathname = headers().get("x-pathname") || ""
|
||||
const isSignupRoute = isSignupPage(pathname)
|
||||
|
||||
switch (params.contentType) {
|
||||
case "collection-page":
|
||||
if (env.HIDE_FOR_NEXT_RELEASE) {
|
||||
return notFound()
|
||||
}
|
||||
return <CollectionPage />
|
||||
case "content-page":
|
||||
if (env.HIDE_FOR_NEXT_RELEASE) {
|
||||
case "content-page": {
|
||||
if (!isSignupRoute && env.HIDE_FOR_NEXT_RELEASE) {
|
||||
return notFound()
|
||||
}
|
||||
if (isSignupRoute && !env.SHOW_SIGNUP_FLOW) {
|
||||
return notFound()
|
||||
}
|
||||
return <ContentPage />
|
||||
}
|
||||
case "loyalty-page":
|
||||
return <LoyaltyPage />
|
||||
case "hotel-page":
|
||||
|
||||
Reference in New Issue
Block a user