From fad978e9f491bff55d1966553bde045396eeb9b7 Mon Sep 17 00:00:00 2001 From: Jose Lago Date: Mon, 24 Aug 2026 20:55:29 +0200 Subject: [PATCH] feat: update slot types and enhance TypeBadge display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Stephan Charles Co-authored-by: Amelia Hernandez Co-authored-by: Markus Franz Co-authored-by: Sabrina Hota Co-authored-by: Nilüfer Doğan --- apps/admin/src/components/ui.tsx | 4 +++- apps/convivo/src/lib/types.ts | 2 +- apps/convivo/src/screens/Agenda.tsx | 25 ++++++++++++++++--------- apps/convivo/src/styles.css | 7 ++----- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/apps/admin/src/components/ui.tsx b/apps/admin/src/components/ui.tsx index ab1f3e8..db9f556 100644 --- a/apps/admin/src/components/ui.tsx +++ b/apps/admin/src/components/ui.tsx @@ -81,7 +81,9 @@ export function QrImage({ value, size = 180 }: { value: string; size?: number }) /** Small colored badge for a registration / sponsor type. */ export function TypeBadge({ type }: { type: string }) { - return {type.replace(/_/g, ' ')}; + // "service_session" -> "Service Session" (capitalize each word). + const label = type.replace(/_/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase()); + return {label}; } /** A small on/off toggle switch. */ diff --git a/apps/convivo/src/lib/types.ts b/apps/convivo/src/lib/types.ts index 14d2028..849bc20 100644 --- a/apps/convivo/src/lib/types.ts +++ b/apps/convivo/src/lib/types.ts @@ -1,6 +1,6 @@ export type RegistrationType = 'attendee' | 'speaker' | 'staff' | 'sponsor'; -export type SlotType = 'session' | 'lunch_break' | 'coffee_break' | 'keynote' | 'close_up'; +export type SlotType = 'session' | 'service_session'; /** The signed-in contact (own row, readable via RLS). */ export interface Contact { diff --git a/apps/convivo/src/screens/Agenda.tsx b/apps/convivo/src/screens/Agenda.tsx index 66f90c3..3f04ddd 100644 --- a/apps/convivo/src/screens/Agenda.tsx +++ b/apps/convivo/src/screens/Agenda.tsx @@ -11,7 +11,7 @@ import { setPreference, uploadSessionMaterial, } from '../lib/api'; -import { fmtRange, slotStatus } from '../lib/time'; +import { capWords, fmtRange, slotStatus } from '../lib/time'; import type { Preference, Session } from '../lib/types'; import { Sheet, Spinner } from '../components/ui'; import { useToast } from '../context/ToastContext'; @@ -149,7 +149,7 @@ export function Agenda({ openFeedback }: { openFeedback: (sessionId: string) =>
- {slot.name} {slot.type.replace('_', ' ')} + {slot.name} {capWords(slot.type)}
{fmtRange(slot)}
@@ -160,6 +160,7 @@ export function Agenda({ openFeedback }: { openFeedback: (sessionId: string) => {sessions.map((s) => { const picked = pickFor(slot.id) === s.id; const isMySession = mySpeakerSessions.includes(s.id); + const isService = slot.type === 'service_session'; return (
- ✓ + {!isService && ✓} ); })} @@ -224,12 +225,18 @@ export function Agenda({ openFeedback }: { openFeedback: (sessionId: string) => You weren’t checked in to this session. )} - + {selSlot.type === 'service_session' ? ( +
+ No pick needed for this slot. +
+ ) : ( + + )} {/* Material download (all attendees) — pinned to the bottom. */} {selected.material_path && ( diff --git a/apps/convivo/src/styles.css b/apps/convivo/src/styles.css index 5b4ed52..a82126e 100644 --- a/apps/convivo/src/styles.css +++ b/apps/convivo/src/styles.css @@ -61,12 +61,9 @@ body { .pill.reg-speaker { background: rgba(124,58,237,.12); border-color: rgba(124,58,237,.4); color: #6d28d9; } .pill.reg-staff { background: rgba(220,38,38,.12); border-color: rgba(220,38,38,.4); color: #b91c1c; } .pill.reg-sponsor { background: rgba(234,88,12,.13); border-color: rgba(234,88,12,.4); color: #c2410c; } -/* slot types */ +/* slot types (slot_type enum: session | service_session) */ .pill.slot-type-session { background: rgba(14,165,233,.12); border-color: rgba(14,165,233,.4); color: #0369a1; } -.pill.slot-type-lunch_break { background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.4); color: #b45309; } -.pill.slot-type-coffee_break { background: rgba(120,113,108,.14); border-color: rgba(120,113,108,.4); color: #57534e; } -.pill.slot-type-keynote { background: var(--accent-soft); border-color: rgba(213,0,0,.35); color: var(--accent); } -.pill.slot-type-close_up { background: rgba(5,150,105,.12); border-color: rgba(5,150,105,.35); color: var(--green); } +.pill.slot-type-service_session { background: rgba(120,113,108,.14); border-color: rgba(120,113,108,.4); color: #57534e; } .pill.speaker-tag { background: rgba(124,58,237,.12); border-color: rgba(124,58,237,.4); color: #6d28d9; padding: 2px 8px; font-size: 11px; } /* pending-connection red dot on the Connect tab */ .tab .ico { position: relative; display: inline-flex; }