diff --git a/components/campaigns/AnnouncementHero.tsx b/components/campaigns/AnnouncementHero.tsx index bee864e495c6..005bbb1719e7 100644 --- a/components/campaigns/AnnouncementHero.tsx +++ b/components/campaigns/AnnouncementHero.tsx @@ -54,7 +54,7 @@ export default function AnnouncementHero({ className = '', small = false }: IAnn {numberOfVisibleBanners > 1 && (
@@ -62,21 +62,30 @@ export default function AnnouncementHero({ className = '', small = false }: IAnn )}
- {visibleBanners.map((banner, index) => ( - - ))} + {visibleBanners.map((banner, index) => { + // Only render active banner and immediate neighbors + const isVisible = Math.abs(index - (activeIndex % numberOfVisibleBanners)) <= 1; + + if (!isVisible) { + return null; + } + + return ( + + ); + })}
{visibleBanners.map((banner, index) => ( @@ -93,7 +102,7 @@ export default function AnnouncementHero({ className = '', small = false }: IAnn {numberOfVisibleBanners > 1 && (