Skip to content

Commit

Permalink
Merge branch 'master' into fix/issue-3540-toc-links
Browse files Browse the repository at this point in the history
  • Loading branch information
anshgoyalevil authored Jan 27, 2025
2 parents 7441ea6 + eda1544 commit 2df46be
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions components/campaigns/AnnouncementHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,28 @@ export default function AnnouncementHero({ className = '', small = false }: IAnn
)}
<div className='relative flex w-5/6 flex-col items-center justify-center gap-2'>
<div className='relative flex min-h-72 w-full items-center justify-center overflow-hidden lg:h-[17rem] lg:w-[38rem]'>
{visibleBanners.map((banner, index) => (
<Banner
key={index}
title={banner.title}
dateLocation={banner.dateLocation}
cfaText={banner.cfaText}
eventName={banner.eventName}
cfpDeadline={banner.cfpDeadline}
link={banner.link}
city={banner.city}
activeBanner={index === activeIndex % numberOfVisibleBanners}
className={className}
small={small}
/>
))}
{visibleBanners.map((banner, index) => {
// Only render active banner and immediate neighbors
const isVisible = Math.abs(index - (activeIndex % numberOfVisibleBanners)) <= 1;

if (!isVisible) return null;

return (
<Banner
key={index}
title={banner.title}
dateLocation={banner.dateLocation}
cfaText={banner.cfaText}
eventName={banner.eventName}
cfpDeadline={banner.cfpDeadline}
link={banner.link}
city={banner.city}
activeBanner={index === activeIndex % numberOfVisibleBanners}
className={className}
small={small}
/>
);
})}
</div>
<div className='m-auto flex justify-center'>
{visibleBanners.map((banner, index) => (
Expand Down

0 comments on commit 2df46be

Please sign in to comment.