diff --git a/sites/portal/src/app/admin/page.tsx b/sites/portal/src/app/admin/page.tsx index f03a519..5e1b745 100644 --- a/sites/portal/src/app/admin/page.tsx +++ b/sites/portal/src/app/admin/page.tsx @@ -26,7 +26,6 @@ export default function AdminPage() { description: '', location: '', eventDate: '', - pointsValue: 10, maxCheckIns: '', }); @@ -47,7 +46,6 @@ export default function AdminPage() { description: '', location: '', eventDate: '', - pointsValue: 10, maxCheckIns: '', }); setShowCreateEvent(false); @@ -71,6 +69,14 @@ export default function AdminPage() { }, }); + const regenerateQRMutation = trpc.events.regenerateQR.useMutation({ + onSuccess: (updatedEvent) => { + utils.events.listAll.invalidate(); + generateQRCode(updatedEvent.qrCode); + setSelectedEvent(updatedEvent); + }, + }); + // Auth & Admin Guard useEffect(() => { if (status === 'unauthenticated') { @@ -103,7 +109,6 @@ export default function AdminPage() { description: eventForm.description || undefined, location: eventForm.location || undefined, eventDate: new Date(eventForm.eventDate), - pointsValue: eventForm.pointsValue, maxCheckIns: eventForm.maxCheckIns ? parseInt(eventForm.maxCheckIns) : undefined, }); }; @@ -208,33 +213,17 @@ export default function AdminPage() { -
-
- - setEventForm({ ...eventForm, pointsValue: parseInt(e.target.value) })} - className="w-full bg-black/40 border border-white/10 rounded-lg px-4 py-3 text-white text-sm focus:border-red-500 focus:outline-none transition-all" - min="1" - max="100" - /> -
- -
- - setEventForm({ ...eventForm, maxCheckIns: e.target.value })} - className="w-full bg-black/40 border border-white/10 rounded-lg px-4 py-3 text-white text-sm focus:border-red-500 focus:outline-none transition-all" - placeholder="Unlimited" - /> -
+
+ + setEventForm({ ...eventForm, maxCheckIns: e.target.value })} + className="w-full bg-black/40 border border-white/10 rounded-lg px-4 py-3 text-white text-sm focus:border-red-500 focus:outline-none transition-all" + placeholder="Unlimited" + />
-
- POINTS: - +{selectedEvent.pointsValue} -
CHECK-INS: @@ -325,6 +310,18 @@ export default function AdminPage() { Copy Code
+ + @@ -440,9 +437,8 @@ export default function AdminPage() { )}
- {event.location && {event.location}} - {new Date(event.eventDate).toLocaleString()} - +{event.pointsValue} pts + {event.location && 📍 {event.location}} + 📅 {new Date(event.eventDate).toLocaleString()} 👥 {event.currentCheckIns} check-ins {event.maxCheckIns && ` / ${event.maxCheckIns}`}