feat: update slot types and enhance TypeBadge display

This commit is contained in:
Lago committed 2026-08-24 20:55:29 +02:00
1 parent f7aea663d8
commit 2db22984fc
4 files changed
+22 -16

No files matched your search

+1 -1
View File
@@ -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 {
+16 -9
View File
@@ -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) =>
<div className="slot-head">
<div className="grow">
<div className="name">
{slot.name} <span className={`pill slot-type-${slot.type}`}>{slot.type.replace('_', ' ')}</span>
{slot.name} <span className={`pill slot-type-${slot.type}`}>{capWords(slot.type)}</span>
</div>
<div className="time">{fmtRange(slot)}</div>
</div>
@@ -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 (
<button key={s.id} className={`sess ${picked ? 'picked' : ''}`} onClick={() => setSelected(s)}>
<div className="grow">
@@ -172,7 +173,7 @@ export function Agenda({ openFeedback }: { openFeedback: (sessionId: string) =>
{s.material_path && <span style={{ marginLeft: 6 }}>📎</span>}
</div>
</div>
<span className="check">✓</span>
{!isService && <span className="check">✓</span>}
</button>
);
})}
@@ -224,12 +225,18 @@ export function Agenda({ openFeedback }: { openFeedback: (sessionId: string) =>
You weren’t checked in to this session.
</div>
)}
<button
className={`btn ${pickFor(selected.slot_id) === selected.id ? 'danger' : 'primary'}`}
onClick={() => togglePick(selected.slot_id, selected.id)}
>
{pickFor(selected.slot_id) === selected.id ? 'Remove my pick' : 'Pick this session'}
</button>
{selSlot.type === 'service_session' ? (
<div className="muted small" style={{ textAlign: 'center' }}>
No pick needed for this slot.
</div>
) : (
<button
className={`btn ${pickFor(selected.slot_id) === selected.id ? 'danger' : 'primary'}`}
onClick={() => togglePick(selected.slot_id, selected.id)}
>
{pickFor(selected.slot_id) === selected.id ? 'Remove my pick' : 'Pick this session'}
</button>
)}
{/* Material download (all attendees) — pinned to the bottom. */}
{selected.material_path && (
<a className="btn primary" href={sessionMaterialUrl(selected.material_path)} target="_blank" rel="noreferrer">
+2 -5
View File
@@ -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; }