This commit is contained in:
Mackie 2026-05-25 03:45:59 +08:00
parent d65b79672f
commit d4cd9148ae
2 changed files with 12 additions and 9 deletions

View file

@ -73,9 +73,13 @@ export default async function Page({ params: paramsPromise }: Args) {
const { hero, layout } = page const { hero, layout } = page
if (decodedSlug === 'home') { if (decodedSlug === 'home') {
return <HeroPage richText={hero.richText} links={hero.links} layout={layout} /> return (
} <HeroPage richText={hero.richText} links={hero.links}>
<RenderBlocks blocks={layout} />
</HeroPage>
)
}
return ( return (
<div style={{ position: 'relative', minHeight: '100vh' }}> <div style={{ position: 'relative', minHeight: '100vh' }}>

View file

@ -10,7 +10,6 @@ import { useThemeMode } from '@/hooks/useThemeMode'
import { CMSLink } from '@/components/Link' import { CMSLink } from '@/components/Link'
import RichText from '@/components/RichText' import RichText from '@/components/RichText'
import type { Page } from '@/payload-types' import type { Page } from '@/payload-types'
import { RenderBlocks } from '@/blocks/RenderBlocks'
import { Button } from '@/components/ui/button' import { Button } from '@/components/ui/button'
// ─── Types ──────────────────────────────────────────────────────────────────── // ─── Types ────────────────────────────────────────────────────────────────────
@ -285,10 +284,10 @@ function LogosSection({ isDark }: { isDark: boolean }) {
interface HeroPageProps { interface HeroPageProps {
richText?: Page['hero']['richText'] richText?: Page['hero']['richText']
links?: Page['hero']['links'] links?: Page['hero']['links']
layout?: Page['layout'] children?: React.ReactNode
} }
export default function HeroPage({ richText, links, layout }: HeroPageProps) { export default function HeroPage({ richText, links, children }: HeroPageProps) {
const { isDark, toggle } = useThemeMode() const { isDark, toggle } = useThemeMode()
return ( return (
@ -303,10 +302,10 @@ export default function HeroPage({ richText, links, layout }: HeroPageProps) {
<div style={{ position: 'relative', zIndex: 1 }}> <div style={{ position: 'relative', zIndex: 1 }}>
<main> <main>
<HeroSection isDark={isDark} richText={richText} links={links} /> <HeroSection isDark={isDark} richText={richText} links={links} />
<LogosSection isDark={isDark} /> <LogosSection isDark={isDark} />
{layout && layout.length > 0 && ( {children && (
<div id="skills"> <div id="skills">
<RenderBlocks blocks={layout} /> {children}
</div> </div>
)} )}
</main> </main>