Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions src/components/CommunityPortal/Calendar/CommunityCalendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export default function CommunityCalendar() {
setEvents(response.data.events || []);
} catch (err) {
setError('Failed to load events');
console.error('Error fetching calendar events:', err);
} finally {
setIsLoading(false);
}
Expand All @@ -58,6 +57,7 @@ export default function CommunityCalendar() {
description: event.description || `Join us for ${event.title}`,
// Ensure location is present or default
location: event.location || 'Online',
isOver: eventDate < new Date(),
};
});
}, [events]);
Expand Down Expand Up @@ -634,7 +634,6 @@ export default function CommunityCalendar() {
{selectedEvent.status}
</span>
</div>

<div className={styles.eventDetailsGrid}>
{[
['Type', selectedEvent.type],
Expand All @@ -656,12 +655,21 @@ export default function CommunityCalendar() {
</div>

<div className={styles.modalActions}>
<button type="button" className={styles.btnPrimary}>
Register for Event
</button>
<button type="button" className={styles.btnSecondary}>
Add to Calendar
</button>
{selectedEvent.isOver ? (
<button type="button" className={styles.btnDisabled} disabled>
Completed
</button>
) : (
<>
<button type="button" className={styles.btnPrimary}>
Register for Event
</button>

<button type="button" className={styles.btnSecondary}>
Add to Calendar
</button>
</>
)}
</div>
</div>
</div>
Expand Down
Loading
Loading