feat: add draft completion banner and event handler for draft completion state

This commit is contained in:
Chris Parsons 2025-10-18 23:33:13 -07:00
parent 01b9e23eaf
commit f86dfade38

View file

@ -182,6 +182,7 @@ export default function DraftRoom() {
const [sportFilter, setSportFilter] = useState<string>("all");
const [queue, setQueue] = useState(userQueue);
const [isPaused, setIsPaused] = useState(season.draftPaused || false);
const [isDraftComplete, setIsDraftComplete] = useState(season.status === "active");
const [teamTimers, setTeamTimers] = useState<Record<string, number>>(() => {
// Initialize with timers from loader data
const timersMap: Record<string, number> = {};
@ -220,16 +221,22 @@ export default function DraftRoom() {
setIsPaused(false);
};
const handleDraftCompleted = () => {
setIsDraftComplete(true);
};
on("pick-made", handlePickMade);
on("timer-update", handleTimerUpdate);
on("draft-paused", handleDraftPaused);
on("draft-resumed", handleDraftResumed);
on("draft-completed", handleDraftCompleted);
return () => {
off("pick-made", handlePickMade);
off("timer-update", handleTimerUpdate);
off("draft-paused", handleDraftPaused);
off("draft-resumed", handleDraftResumed);
off("draft-completed", handleDraftCompleted);
};
}, [on, off, currentPick]);
@ -507,6 +514,13 @@ export default function DraftRoom() {
return (
<div className="min-h-screen bg-background">
{/* Draft Completion Banner */}
{isDraftComplete && (
<div className="bg-green-500 text-white px-4 py-3 text-center font-semibold">
🎉 Draft Complete! The season is now active.
</div>
)}
{/* Standalone Header - No Main Nav */}
<div className="border-b bg-card">
<div className="w-full px-4 py-4">