The Events page (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/asubap/website/llms.txt
Use this file to discover all available pages before exploring further.
/events) is the central hub for all chapter activities and is accessible to every visitor without a login. The page dynamically adjusts its capabilities based on the authenticated role: anonymous visitors can browse events freely; authenticated general members and sponsors can RSVP and check in; e-board administrators gain the ability to create, edit, delete, announce, and toggle the visibility of events. All data fetching uses a single useEffect that re-runs whenever session or authLoading changes, so the event list automatically refreshes after login without a page reload.
Endpoint Selection
The fetch endpoint and request headers differ based on whether a session token is present:AbortController is wired to the fetch so in-flight requests are cancelled if the component unmounts mid-request or the session changes before the response arrives.
Event Type System
Three-Section Layout
Events are partitioned into three sections based on theisEventInSession() utility and the current timestamp. Past events are sorted newest-first; upcoming events are sorted chronologically.
- Events In-Session
- Upcoming Events
- Past Events
Events currently running (within their check-in window). The RSVP button is hidden (
hideRSVP={true}) since the check-in window is open. Displayed with a LoadingSpinner while either the events fetch or the user-rank fetch is pending.Search
ASearchInput component filters the event list in real time. The filter evaluates event_name, event_location, and event_description (all case-insensitive):
Calendar Subscribe
ACalendarSubscribeButton component sits in the toolbar row next to the search bar. It allows visitors to subscribe to the chapter’s public event calendar (e.g., an .ics feed), so events appear in their personal calendars automatically.
Role-Gated Features
General Members & Sponsors — RSVP
General Members & Sponsors — RSVP
The
EventRSVP sub-component renders on upcoming and in-session events for role === "general-member" or role === "sponsor". It reads user_rsvped from the event object and shows a toggle. RSVPs are blocked if event.rsvp_count >= event.event_limit (isRSVPFull).General Members — Check-In
General Members — Check-In
The
EventCheckIn sub-component renders for role === "general-member" on non-past events. Check-in availability is controlled by can_check_in from the API (requires the user to have RSVP’d and be within the geo-radius and time window). Alumni users (isAlumni(userRank)) are excluded from both RSVP and check-in controls.E-Board — Event Management
E-Board — Event Management
When
Both destructive actions (delete, announce) require confirmation via
role === "e-board", each EventCard gains three icon buttons:| Icon | Action | API call |
|---|---|---|
Megaphone | Announce (upcoming only) | POST /events/send-event with { event_id, recipient_filter: "rsvped" } |
MoreHorizontal | Edit | Opens EditEventModal → PUT to update event |
Trash2 | Delete | POST /events/delete-event with { event_id } |
ConfirmationModal before the API request is dispatched.E-Board — Hidden Events Toggle
E-Board — Hidden Events Toggle
E-Board — Participant Management
E-Board — Participant Management
Expanding the “RSVPs and Attendees” accordion on any EventCard triggers E-board can also manually add RSVPs or attendees via search modals that hit
GET /events/:id/participants. The response is transformed client-side into EventParticipants:POST /events/rsvp/:id and POST /events/add-member-attending, and remove them via POST /events/unrsvp/:id and POST /events/delete-member-attending.User Rank Fetch
To determine whether a logged-in member is alumni (and should therefore be blocked from RSVP/check-in), the page fetches the member’s rank on mount and on window focus:general-member and sponsor roles.
Deep-Link Highlighting
The page supports alocation.state.highlightEventId parameter (set by other pages navigating to a specific event). After events finish loading, the targeted EventCard is scrolled into view and receives a ring-bapred ring highlight for 2 seconds before fading back to ring-transparent.
Event refs are tracked in a
useRef<Map<string, HTMLDivElement>> keyed by event.id. This avoids re-renders when refs are registered and ensures smooth scroll behavior even when the target event is in the past section (which requires the full list to be loaded first).