Skip to content

Commit

Permalink
Only show volunteer status for upcoming events
Browse files Browse the repository at this point in the history
  • Loading branch information
parkerdavis1 committed Dec 28, 2023
1 parent 0aab36e commit 0d56cdf
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions app/components/EventAgenda.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,21 @@ function PositionStatus({ volunteerType, event }: PositionStatusProps) {
}

export function EventAgenda({ event }: { event: EventWithVolunteers }) {
const eventIsUpcoming = event.end.valueOf() > new Date().valueOf()

return (
<div className="flex min-w-[25rem] gap-4">
<div className="shrink-0 grow basis-40">{event.title}</div>
<div className="flex shrink-0 grow basis-72 flex-col text-sm">
<div className="max-w-sm">
{volunteerTypes.map(volunteerType => (
<PositionStatus
key={volunteerType.field}
volunteerType={volunteerType}
event={event}
/>
))}
{eventIsUpcoming &&
volunteerTypes.map(volunteerType => (
<PositionStatus
key={volunteerType.field}
volunteerType={volunteerType}
event={event}
/>
))}
</div>
</div>
</div>
Expand Down

0 comments on commit 0d56cdf

Please sign in to comment.