hero
This commit is contained in:
parent
ada4349ed4
commit
5c0c2e25dc
1 changed files with 21 additions and 10 deletions
|
|
@ -13,6 +13,10 @@ import { generateMeta } from '@/utilities/generateMeta'
|
||||||
import PageClient from './page.client'
|
import PageClient from './page.client'
|
||||||
import { LivePreviewListener } from '@/components/LivePreviewListener'
|
import { LivePreviewListener } from '@/components/LivePreviewListener'
|
||||||
|
|
||||||
|
// ADD these two lines after the LivePreviewListener import:
|
||||||
|
import HeroBackground from '@/components/HeroBackground'
|
||||||
|
import HeroPage from '@/components/HeroPage'
|
||||||
|
|
||||||
export async function generateStaticParams() {
|
export async function generateStaticParams() {
|
||||||
const payload = await getPayload({ config: configPromise })
|
const payload = await getPayload({ config: configPromise })
|
||||||
const pages = await payload.find({
|
const pages = await payload.find({
|
||||||
|
|
@ -66,17 +70,24 @@ export default async function Page({ params: paramsPromise }: Args) {
|
||||||
|
|
||||||
const { hero, layout } = page
|
const { hero, layout } = page
|
||||||
|
|
||||||
|
// REPLACE WITH:
|
||||||
|
if (decodedSlug === 'home') {
|
||||||
|
return <HeroPage />
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<article className="pt-16 pb-24">
|
<div style={{ position: 'relative', minHeight: '100vh' }}>
|
||||||
<PageClient />
|
<div style={{ position: 'fixed', inset: 0, zIndex: 0 }}>
|
||||||
{/* Allows redirects for valid pages too */}
|
<HeroBackground showToggle={false} />
|
||||||
<PayloadRedirects disableNotFound url={url} />
|
</div>
|
||||||
|
<article className="pt-16 pb-24" style={{ position: 'relative', zIndex: 1 }}>
|
||||||
{draft && <LivePreviewListener />}
|
<PageClient />
|
||||||
|
<PayloadRedirects disableNotFound url={url} />
|
||||||
<RenderHero {...hero} />
|
{draft && <LivePreviewListener />}
|
||||||
<RenderBlocks blocks={layout} />
|
<RenderHero {...hero} />
|
||||||
</article>
|
<RenderBlocks blocks={layout} />
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue