diff --git a/apps/spa/src/components/DynamicPageRenderer.tsx b/apps/spa/src/components/DynamicPageRenderer.tsx index 4eab24f..47efb3a 100644 --- a/apps/spa/src/components/DynamicPageRenderer.tsx +++ b/apps/spa/src/components/DynamicPageRenderer.tsx @@ -37,8 +37,19 @@ export default function DynamicPageRenderer({ categoriesLoading }: DynamicPageRendererProps) { useEffect(() => { - const HERO_TYPES = new Set(['HERO', 'HERO_V2', 'HERO_VIDEO']); + const HERO_TYPES = new Set([ + 'HERO', + 'HERO_V2', + 'HERO_VIDEO', + 'HERO_ARTICLE', + 'HERO_MINIMAL', + 'HERO_SPLIT_MINIMAL', + 'HERO_VIDEO_MINIMAL', + ]); const firstActiveSection = sections.find(s => s.isActive && s.type.toUpperCase() !== 'ANNOUNCEMENT_BAR'); + if (!firstActiveSection && sections.length > 0 && sections.every(s => !s.isActive || s.type.toUpperCase() === 'ANNOUNCEMENT_BAR')) { + return; + } const isHero = Boolean(firstActiveSection && HERO_TYPES.has(firstActiveSection.type.toUpperCase())); if (typeof document !== 'undefined') { diff --git a/apps/spa/src/pages/CustomPage.tsx b/apps/spa/src/pages/CustomPage.tsx index 567abb5..b995b74 100644 --- a/apps/spa/src/pages/CustomPage.tsx +++ b/apps/spa/src/pages/CustomPage.tsx @@ -23,7 +23,15 @@ export default function CustomPage() { (section) => !(section.isActive && section.type.toUpperCase() === 'ANNOUNCEMENT_BAR') ); - const HERO_TYPES = new Set(['HERO', 'HERO_V2', 'HERO_VIDEO']); + const HERO_TYPES = new Set([ + 'HERO', + 'HERO_V2', + 'HERO_VIDEO', + 'HERO_ARTICLE', + 'HERO_MINIMAL', + 'HERO_SPLIT_MINIMAL', + 'HERO_VIDEO_MINIMAL', + ]); const hasHeroFirst = contentSections.length > 0 && HERO_TYPES.has(contentSections[0].type.toUpperCase()); useEffect(() => { diff --git a/apps/website/src/components/dynamic/DynamicPageRenderer.tsx b/apps/website/src/components/dynamic/DynamicPageRenderer.tsx index 32ba40c..5a89f79 100644 --- a/apps/website/src/components/dynamic/DynamicPageRenderer.tsx +++ b/apps/website/src/components/dynamic/DynamicPageRenderer.tsx @@ -1897,8 +1897,19 @@ export default function DynamicPageRenderer({ sections, categories, lang: langPr const lang = langProp ?? i18nLang useEffect(() => { - const HERO_TYPES = new Set(['HERO', 'HERO_V2', 'HERO_VIDEO']) + const HERO_TYPES = new Set([ + 'HERO', + 'HERO_V2', + 'HERO_VIDEO', + 'HERO_ARTICLE', + 'HERO_MINIMAL', + 'HERO_SPLIT_MINIMAL', + 'HERO_VIDEO_MINIMAL', + ]) const firstActiveSection = sections.find(s => s.isActive && s.type.toUpperCase() !== 'ANNOUNCEMENT_BAR') + if (!firstActiveSection && sections.length > 0 && sections.every(s => !s.isActive || s.type.toUpperCase() === 'ANNOUNCEMENT_BAR')) { + return + } const isHero = Boolean(firstActiveSection && HERO_TYPES.has(firstActiveSection.type.toUpperCase())) if (typeof document !== 'undefined') {