Skip to content

Commit

Permalink
Bring back "Compare top 5 prospects" links for Draft and Draft Scouti…
Browse files Browse the repository at this point in the history
…ng pages
  • Loading branch information
dumbmatter committed Feb 8, 2025
1 parent 3f49ee0 commit e04229d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
4 changes: 0 additions & 4 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
export bug https://discord.com/channels/290013534023057409/290015591216054273/1335186753593802763

show # of teams in each division when making expansion draft https://old.reddit.com/r/BasketballGM/comments/1iingd3/i_added_a_bunch_of_expansion_teams_but_added_too/

https://www.compart.com/en/unicode/U+1F3C6 rather than ring

bring back compre top 5 draft links

apply checkbox td hack to buttons too
- should correctly handle hover state
- bootstrap utility?
Expand Down
17 changes: 17 additions & 0 deletions src/ui/views/Draft.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,23 @@ const Draft = ({
<RosterComposition className="mb-3 ms-sm-3" players={userPlayers} />
</div>

{undrafted.length > 1 ? (
<div className="mb-3">
<a
href={helpers.leagueUrl([
"compare_players",
undrafted
.slice(0, 5)
.map((p) => `${p.pid}-${season}-r`)
.join(","),
])}
>
Compare top {Math.min(5, undrafted.length)} remaining{" "}
{helpers.plural("prospect", undrafted.length)}
</a>
</div>
) : null}

<div className={wrapperClasses}>
<div className={undraftedColClasses}>
<h2>
Expand Down
17 changes: 16 additions & 1 deletion src/ui/views/DraftScouting/DraftClass.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from "react";
import { DataTable, LeagueFileUpload } from "../../components";
import { downloadFile, getCols, toWorker } from "../../util";
import { downloadFile, getCols, helpers, toWorker } from "../../util";
import type { View } from "../../../common/types";
import { WEBSITE_ROOT } from "../../../common";
import { wrappedPlayerNameLabels } from "../../components/PlayerNameLabels";
Expand Down Expand Up @@ -105,6 +105,21 @@ const DraftClass = ({
</button>
) : null}
</div>
{players.length > 1 ? (
<a
className="text-nowrap ms-auto"
href={helpers.leagueUrl([
"compare_players",
players
.slice(0, 5)
.map((p) => `${p.pid}-${season}-r`)
.join(","),
])}
>
Compare top {Math.min(5, players.length)}{" "}
{helpers.plural("prospect", players.length)}
</a>
) : null}
</div>
)}

Expand Down

0 comments on commit e04229d

Please sign in to comment.