diff --git a/app/routes/leagues/$leagueId.tsx b/app/routes/leagues/$leagueId.tsx index 86a69a4..fc497f8 100644 --- a/app/routes/leagues/$leagueId.tsx +++ b/app/routes/leagues/$leagueId.tsx @@ -183,134 +183,140 @@ export default function LeagueHome({ loaderData }: Route.ComponentProps) { )} -
- {isUserCommissioner && season && availableTeamCount > 0 && ( - +
+ {/* Left Column - 2/3 width on desktop */} +
+ {isUserCommissioner && season && availableTeamCount > 0 && ( + + + Invite Link + + Share this link to invite people to join your league ( + {availableTeamCount} spot{availableTeamCount !== 1 ? "s" : ""}{" "} + available) + + + +
+ e.currentTarget.select()} + /> + +
+

+ Anyone with this link can join your league +

+
+
+ )} + + - Invite Link + Teams - Share this link to invite people to join your league ( - {availableTeamCount} spot{availableTeamCount !== 1 ? "s" : ""}{" "} - available) + {teams.length} team{teams.length !== 1 ? "s" : ""} in this league - -
- e.currentTarget.select()} - /> - + +
+ {teams.map((team) => { + const isOwned = team.ownerId === currentUserId; + const ownerName = team.ownerId ? ownerMap[team.ownerId] : null; + return ( + + + {team.name} + + {team.ownerId ? ( + isOwned ? ( + + Your Team + + ) : ( + {ownerName || "Unknown Owner"} + ) + ) : ( + + Available + + )} + + + + ); + })}
-

- Anyone with this link can join your league -

- )} +
- - - Teams - - {teams.length} team{teams.length !== 1 ? "s" : ""} in this league - - - -
- {teams.map((team) => { - const isOwned = team.ownerId === currentUserId; - const ownerName = team.ownerId ? ownerMap[team.ownerId] : null; - return ( - - - {team.name} - - {team.ownerId ? ( - isOwned ? ( - - Your Team - - ) : ( - {ownerName || "Unknown Owner"} - ) - ) : ( - - Available - - )} - - - - ); - })} -
-
-
- - - - League Info - - -
-

Created

-

- {new Date(league.createdAt).toLocaleDateString()} -

-
- {season && ( + {/* Right Column - 1/3 width on desktop */} +
+ + + League Info + +
-

Season Status

-

- {season.status.replace("_", " ")} +

Created

+

+ {new Date(league.createdAt).toLocaleDateString()}

- )} -
-
+ {season && ( +
+

Season Status

+

+ {season.status.replace("_", " ")} +

+
+ )} + + - - - Commissioners - - {commissioners.length} commissioner - {commissioners.length !== 1 ? "s" : ""} - - - -
- {commissioners.map((commissioner) => { - const commissionerName = commissionerMap[commissioner.userId]; - return ( -
-

- {commissionerName || "Unknown User"} - {commissioner.userId === currentUserId && ( - (You) - )} -

-
- ); - })} -
-
-
+ + + Commissioners + + {commissioners.length} commissioner + {commissioners.length !== 1 ? "s" : ""} + + + +
+ {commissioners.map((commissioner) => { + const commissionerName = commissionerMap[commissioner.userId]; + return ( +
+

+ {commissionerName || "Unknown User"} + {commissioner.userId === currentUserId && ( + (You) + )} +

+
+ ); + })} +
+
+
+
);