Merged in fix/destinationpages-loading-tweaks (pull request #1605)
Suspense destination pages fixes and some performance improvements * Suspense destination pages fixes and some performance improvements Approved-by: Erik Tiekstra
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { headers } from "next/headers"
|
||||
import { notFound, redirect } from "next/navigation"
|
||||
import { Suspense } from "react"
|
||||
|
||||
import { overview } from "@/constants/routes/myPages"
|
||||
import { isSignupPage } from "@/constants/routes/signup"
|
||||
@@ -8,7 +9,9 @@ import { getHotelPage } from "@/lib/trpc/memoizedRequests"
|
||||
|
||||
import { auth } from "@/auth"
|
||||
import DestinationCityPage from "@/components/ContentType/DestinationPage/DestinationCityPage"
|
||||
import DestinationCityPageSkeleton from "@/components/ContentType/DestinationPage/DestinationCityPage/DestinationCityPageSkeleton"
|
||||
import DestinationCountryPage from "@/components/ContentType/DestinationPage/DestinationCountryPage"
|
||||
import DestinationCountryPageSkeleton from "@/components/ContentType/DestinationPage/DestinationCountryPage/DestinationCountryPageSkeleton"
|
||||
import DestinationOverviewPage from "@/components/ContentType/DestinationPage/DestinationOverviewPage"
|
||||
import HotelPage from "@/components/ContentType/HotelPage"
|
||||
import HotelSubpage from "@/components/ContentType/HotelSubpage"
|
||||
@@ -62,9 +65,17 @@ export default async function ContentTypePage({
|
||||
case PageContentTypeEnum.destinationOverviewPage:
|
||||
return <DestinationOverviewPage />
|
||||
case PageContentTypeEnum.destinationCountryPage:
|
||||
return <DestinationCountryPage />
|
||||
return (
|
||||
<Suspense fallback={<DestinationCountryPageSkeleton />}>
|
||||
<DestinationCountryPage />
|
||||
</Suspense>
|
||||
)
|
||||
case PageContentTypeEnum.destinationCityPage:
|
||||
return <DestinationCityPage />
|
||||
return (
|
||||
<Suspense fallback={<DestinationCityPageSkeleton />}>
|
||||
<DestinationCityPage />
|
||||
</Suspense>
|
||||
)
|
||||
case PageContentTypeEnum.hotelPage:
|
||||
if (env.HIDE_FOR_NEXT_RELEASE) {
|
||||
return notFound()
|
||||
|
||||
Reference in New Issue
Block a user