Skip to content

Commit

Permalink
chore: don't show upcoming events title if they aren't any
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenixpereira committed Apr 2, 2024
1 parent c0cdd70 commit ff651df
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/app/events/Events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,14 @@ export default function Events({ className }: { className?: string }) {

return (
<section className={`${className} space-y-8`}>
<Title>{'Upcoming Events'}</Title>
{upcomingEvents.map((event, i) => (
<EventCard key={i} index={i} event={event} />
))}
{upcomingEvents.length > 0 && (
<>
<Title>{'Upcoming Events'}</Title>
{upcomingEvents.map((event, i) => (
<EventCard key={i} index={i} event={event} />
))}
</>
)}

{pastEvents.length > 0 && (
<>
Expand Down

0 comments on commit ff651df

Please sign in to comment.