Compare commits

..

1 commit

Author SHA1 Message Date
Chris Parsons
41481a9812 Fix invite link showing http and add draft board link during live draft
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 1m24s
🚀 Deploy / ʦ TypeScript (pull_request) Successful in 1m15s
🚀 Deploy / 🔍 Lint (pull_request) Successful in 48s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
- Use x-forwarded-proto header (allowlisted to http/https only) when
  building the invite link origin so it shows https behind a TLS proxy
- Show "View Draft Board" link in the DraftInfoCard header when the
  draft is actively running, matching the link already shown on
  active/completed seasons

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 22:26:49 -07:00
2 changed files with 27 additions and 11 deletions

View file

@ -18,6 +18,8 @@ export interface DraftInfoCardProps {
isDraftOrderSet: boolean; isDraftOrderSet: boolean;
/** true when season status is pre_draft or draft */ /** true when season status is pre_draft or draft */
isDraftOrPreDraft: boolean; isDraftOrPreDraft: boolean;
/** true when season status is specifically draft (live) */
isDraft?: boolean;
draftDateTime?: string | Date | null; draftDateTime?: string | Date | null;
draftBoardHref: string; draftBoardHref: string;
draftRoomHref: string; draftRoomHref: string;
@ -56,8 +58,10 @@ function DraftInfoCardVariant({
draftIncrementTime, draftIncrementTime,
sportsCount, sportsCount,
isDraftOrderSet, isDraftOrderSet,
isDraft,
draftDateTime, draftDateTime,
draftTimezone, draftTimezone,
draftBoardHref,
draftRoomHref, draftRoomHref,
queueBuilderHref, queueBuilderHref,
userDraftPosition, userDraftPosition,
@ -115,15 +119,26 @@ function DraftInfoCardVariant({
<GradientIcon icon={LayoutGrid} className="h-5 w-5 shrink-0" /> <GradientIcon icon={LayoutGrid} className="h-5 w-5 shrink-0" />
<h2 className="text-xl font-bold leading-none tracking-tight">Draft Info</h2> <h2 className="text-xl font-bold leading-none tracking-tight">Draft Info</h2>
</div> </div>
{isDraftOrderSet ? ( <div className="flex items-center gap-3">
<Button asChild> {isDraft && (
<Link to={draftRoomHref}>Enter Draft Room</Link> <Link
</Button> to={draftBoardHref}
) : queueBuilderHref ? ( className="flex items-center gap-0.5 text-xs font-semibold uppercase tracking-wide text-electric hover:underline"
<Button asChild variant="outline"> >
<Link to={queueBuilderHref}>Set Pre-Draft Queue</Link> View Draft Board
</Button> <ChevronRight className="h-3.5 w-3.5" />
) : null} </Link>
)}
{isDraftOrderSet ? (
<Button asChild>
<Link to={draftRoomHref}>Enter Draft Room</Link>
</Button>
) : queueBuilderHref ? (
<Button asChild variant="outline">
<Link to={queueBuilderHref}>Set Pre-Draft Queue</Link>
</Button>
) : null}
</div>
</div> </div>
</CardHeader> </CardHeader>

View file

@ -228,6 +228,7 @@ export default function LeagueHome({ loaderData }: Route.ComponentProps) {
sportsCount={sportsCount} sportsCount={sportsCount}
isDraftOrderSet={isDraftOrderSet} isDraftOrderSet={isDraftOrderSet}
isDraftOrPreDraft={isDraftOrPreDraft} isDraftOrPreDraft={isDraftOrPreDraft}
isDraft={season.status === "draft"}
draftDateTime={season.draftDateTime} draftDateTime={season.draftDateTime}
draftTimezone={currentUserTimezone ?? season.overnightPauseTimezone} draftTimezone={currentUserTimezone ?? season.overnightPauseTimezone}
draftBoardHref={`/leagues/${league.id}/draft-board/${season.id}`} draftBoardHref={`/leagues/${league.id}/draft-board/${season.id}`}
@ -329,8 +330,8 @@ export default function LeagueHome({ loaderData }: Route.ComponentProps) {
/> />
)} )}
{/* Draft historical view - active/completed/draft */} {/* Draft historical view - active/completed only */}
{season && (isActiveOrCompleted || season.status === "draft") && ( {season && isActiveOrCompleted && (
<DraftInfoCard <DraftInfoCard
draftRounds={season.draftRounds} draftRounds={season.draftRounds}
draftTimerMode={season.draftTimerMode} draftTimerMode={season.draftTimerMode}