The Sponsors section of the Admin Dashboard provides full lifecycle management for chapter sponsors. Sponsor data is loaded on dashboard mount viaDocumentation 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.
GET /sponsors/ and stored in two parallel arrays — sponsors[] (company names) and tiers[] (corresponding tier strings) — indexed in sync. The SponsorList component renders these pairs as interactive list rows supporting tier changes, profile editing, and deletion. Adding a sponsor is handled by AddSponsorModal, which collects the company name, tier, email list, and a passcode. All destructive and mutating actions flow through the centralized ConfirmDialog in Admin.tsx.
Tier System
Every sponsor is assigned one of four tiers. Tiers affect how sponsors are displayed in the public-facing sponsor page (ordering, badge color) and can be changed at any time from the admin panel.| Tier | Value |
|---|---|
| Platinum | platinum |
| Gold | gold |
| Silver | silver |
| Bronze | bronze |
AddSponsorModal defaults new sponsors to "bronze". The SponsorList renders an inline <select> per row that triggers a tier change on change.
Fetching Sponsors
On mount,Admin.tsx calls:
ApiSponsor objects:
refetchSponsors() in Admin.tsx re-runs this same fetch and is called after any create, delete, or tier-change operation to keep state synchronized with the server.
Adding a Sponsor
Clicking + New Sponsor opensAddSponsorModal. It is mounted via React.createPortal onto document.body and uses useScrollLock(true).
Form Fields
| Field | Required | Type | Notes |
|---|---|---|---|
| Sponsor Name | ✅ | string | Company name, e.g., "Deloitte" |
| Tier | ✅ | "platinum" | "gold" | "silver" | "bronze" | Dropdown, defaults to "bronze" |
| Email List | ✅ | string[] | Comma-separated emails pasted into a <textarea>, split on , with trim |
| Passcode | ✅ | string | Minimum 6 characters; used for sponsor portal authentication |
Submission
200 OK body (checked by data?.error), the error is surfaced as a toast. On success, handleSponsorAdded re-fetches the full sponsor list from the server via refetchSponsors() to ensure consistency, then closes the modal.
Unsaved Changes Guard
Like all modals in this dashboard,AddSponsorModal computes hasChanges() by JSON-comparing current state to initialStateRef. Closing with unsaved changes prompts a ConfirmationModal:
Passcode System
Each sponsor in the database has apasscode field. This passcode is used by sponsor users to authenticate into the Sponsor Portal — a separate section of the platform where sponsors can view their company profile and interact with the chapter. The passcode is set at creation time (minimum 6 characters) and is not directly editable from the Admin Dashboard UI after creation. It is returned in GET /sponsors/ but should not be exposed in the member-facing UI.
Sponsor accounts are not Supabase auth users in the traditional sense — they authenticate via passcode rather than email/password. The
passcode field stored on the sponsor record is what the sponsor portal checks at login.Deleting a Sponsor
Each sponsor row inSponsorList has a Trash2 icon button. Clicking it sets emailToDelete in local state, which renders a DeleteConfirmation inline component. On confirm, onDelete calls:
sponsors[] state:
Changing a Sponsor’s Tier
The inline<select> in each SponsorList row fires handleChangeTier(email, newTier, e) on change. This calls onTierChangeConfirm (passed from Admin.tsx), which shows the global ConfirmDialog:
actuallyUpdateSponsorTier is called:
refetchSponsors() refreshes the full list to reflect the new tier in the UI.
Updating a Sponsor’s Profile
Clicking theMoreHorizontal icon (or anywhere on the sponsor row) fetches the full sponsor record and opens the ProfileEditModal from src/components/sponsor/ProfileEditModal.tsx.
Fetching Sponsor Details
SponsorProfileData object:
Saving Profile Updates
TheProfileEditModal collects a free-text description (bio) and an array of links. On save, handleSponsorUpdate in SponsorList calls onProfileUpdateConfirm with:
Admin.tsx → actuallyUpdateSponsorProfile posts:
showDiscardConfirmation prop on ProfileEditModal routes the “discard changes?” prompt back through the global showConfirmationDialog helper so it uses the same ConfirmDialog component as the rest of the dashboard.
SponsorList Component
SponsorList receives the parallel emails[] and tiers[] arrays and zips them internally:
Props
The
showConfirmationDialog prop is passed directly from Admin.tsx to allow SponsorList to trigger the top-level ConfirmDialog without owning its own modal state. This keeps the confirmation UX consistent across all dashboard sections.Sponsor Type Reference
API Reference
| Operation | Method | Endpoint | Body |
|---|---|---|---|
| List sponsors | GET | /sponsors/ | — |
| Add sponsor | POST | /sponsors/add-sponsor | { sponsor_name, tier, emailList, passcode } |
| Delete sponsor | POST | /sponsors/delete-sponsor | { sponsor_name } |
| Change tier | POST | /sponsors/change-sponsor-tier | { sponsor_name, tier } |
| Get sponsor profile | POST | /sponsors/get-one-sponsor-info | { sponsor_name } |
| Update sponsor profile | POST | /sponsors/:name/details | { about, links } |