diff --git a/app/components/league/CreateLeagueCard.tsx b/app/components/league/CreateLeagueCard.tsx index fd415d9..d207f89 100644 --- a/app/components/league/CreateLeagueCard.tsx +++ b/app/components/league/CreateLeagueCard.tsx @@ -8,7 +8,7 @@ export function CreateLeagueCard() { return ( - +

Invite friends, pick your sports, and start drafting.

diff --git a/app/components/league/LeagueRow.tsx b/app/components/league/LeagueRow.tsx index 7db8546..f1ad78b 100644 --- a/app/components/league/LeagueRow.tsx +++ b/app/components/league/LeagueRow.tsx @@ -21,9 +21,11 @@ export interface LeagueRowProps { // ─── Helpers ────────────────────────────────────────────────────────────────── function ordinal(n: number): string { - const s = ["th", "st", "nd", "rd"]; const v = n % 100; - return n + (s[(v - 20) % 10] ?? s[v] ?? s[0]); + // 11–13 are always "th" (e.g. 11th, 12th, 13th) + if (v >= 11 && v <= 13) return `${n}th`; + const s = ["th", "st", "nd", "rd"]; + return `${n}${s[n % 10] ?? "th"}`; } @@ -37,7 +39,7 @@ function StatColumn({ children: React.ReactNode; }) { return ( -
+

{label}

@@ -53,10 +55,10 @@ function StatDivider() { // ─── Season progress bar ────────────────────────────────────────────────────── function SeasonProgress({ pct, status }: { pct: number; status: "active" | "completed" }) { - const label = status === "completed" ? "100%" : `${pct}%`; + const label = status === "completed" ? "100% Complete" : `${pct}% Complete`; const fill = status === "completed" ? 100 : pct; return ( -
+
0) { - return ▲{delta}; + return ▲{delta}; } return ( - + ▼{Math.abs(delta)} ); @@ -86,6 +88,7 @@ function RankChange({ current, previous }: { current: number; previous: number | // ─── Row variants ───────────────────────────────────────────────────────────── function DraftRow({ leagueId, leagueName, seasonId, picksUntilMyTurn }: LeagueRowProps) { + const draftUrl = `/leagues/${leagueId}/draft/${seasonId}`; const picksLabel = picksUntilMyTurn === 0 ? "You're on the clock!" @@ -94,7 +97,7 @@ function DraftRow({ leagueId, leagueName, seasonId, picksUntilMyTurn }: LeagueRo : null; return ( -
+

{leagueName}

@@ -109,10 +112,15 @@ function DraftRow({ leagueId, leagueName, seasonId, picksUntilMyTurn }: LeagueRo {picksLabel} )}
+ {seasonId && ( + + )}
{seasonId && ( - )}
@@ -132,15 +140,19 @@ function ActiveRow({ return ( - -
-

{leagueName}

- + {/* Avatar + name */} +
+ +
+

{leagueName}

+ +
+ {/* Stats — second row on mobile, right side on desktop */} {showStats && ( -
+
{currentRank !== undefined && ( #{currentRank} @@ -179,16 +191,20 @@ function PreDraftRow({ return ( - -
-

{leagueName}

-

Pre-Draft

+ {/* Avatar + name */} +
+ +
+

{leagueName}

+

Pre-Draft

+
-
+ {/* Stats — second row on mobile, right side on desktop */} +
- {draftTimeValue} + {draftTimeValue} {draftPosition !== undefined && ( <> @@ -213,7 +229,7 @@ function CompletedRow({ return (
diff --git a/app/components/league/MyLeaguesCard.tsx b/app/components/league/MyLeaguesCard.tsx index ccfec9f..f51e33f 100644 --- a/app/components/league/MyLeaguesCard.tsx +++ b/app/components/league/MyLeaguesCard.tsx @@ -17,9 +17,14 @@ interface MyLeaguesCardProps { } export function MyLeaguesCard({ leagues, viewAllUrl }: MyLeaguesCardProps) { - const sorted = leagues.toSorted( - (a, b) => STATUS_ORDER[a.status] - STATUS_ORDER[b.status] - ); + const sorted = leagues.toSorted((a, b) => { + const statusDiff = STATUS_ORDER[a.status] - STATUS_ORDER[b.status]; + if (statusDiff !== 0) return statusDiff; + if (a.status === "active") { + return (b.completionPercentage ?? 0) - (a.completionPercentage ?? 0); + } + return 0; + }); const right = viewAllUrl ? ( - + {sorted.length === 0 ? (

diff --git a/app/components/ui/SectionCardHeader.tsx b/app/components/ui/SectionCardHeader.tsx index 607ffcd..c983657 100644 --- a/app/components/ui/SectionCardHeader.tsx +++ b/app/components/ui/SectionCardHeader.tsx @@ -15,7 +15,7 @@ interface SectionCardHeaderProps { */ export function SectionCardHeader({ icon, title, right }: SectionCardHeaderProps) { return ( - +

diff --git a/app/routes/home.tsx b/app/routes/home.tsx index a65ddcf..761a505 100644 --- a/app/routes/home.tsx +++ b/app/routes/home.tsx @@ -99,6 +99,10 @@ export async function loader(args: Route.LoaderArgs) { currentRank = standing.currentRank ?? undefined; totalPoints = standing.totalPoints ?? undefined; previousRank = standing.previousRank ?? undefined; + } else if (myTeam && season?.status === "active") { + // No standing row yet (no scoring events) — default to rank 1, 0 points + currentRank = 1; + totalPoints = 0; } const perSeasonEvents = await Promise.all( @@ -209,17 +213,17 @@ function isValidStatus(s: string): s is ValidStatus { return (
{/* - Desktop: 3-col grid, left column (My Leagues + Create) spans 2, right (Events) spans 1. - Mobile: single column stacked in order: My Leagues, Upcoming Events, Create League. + lg+: 3-col grid, left column (My Leagues + Create) spans 2, right (Events) spans 1. + mobile/tablet: single column stacked in order: My Leagues, Upcoming Events, Create League. */} -
+
{/* My Leagues — order 1 on mobile, col-span-2 on desktop */} -
+
{/* Upcoming Events — order 2 on mobile, right column on desktop spanning both rows */} -
+
{/* Create a League — order 3 on mobile, below My Leagues on desktop */} -
+