diff --git a/TODO b/TODO index 484c5e030..fee10f6a0 100644 --- a/TODO +++ b/TODO @@ -2,14 +2,6 @@ apply checkbox td hack to buttons too - should correctly handle hover state - bootstrap utility? -season range highlighting like sports-reference on click highlight -- remove artificial delay -- test - - baseball fielding stats, or disable - - if current season is selected, should update while simming -- blog - - advantages of this: discoverable, no weird floating window, no confusing way to change a range after initial selection - show career totals per team at bottom of stats tables in player profile pages - add some extra option to playersPlus like careerStatsPerTeam diff --git a/src/ui/views/Player/StatsTable.tsx b/src/ui/views/Player/StatsTable.tsx index 9121cf36c..95f82e699 100644 --- a/src/ui/views/Player/StatsTable.tsx +++ b/src/ui/views/Player/StatsTable.tsx @@ -100,27 +100,27 @@ export const StatsTable = ({ cols.at(-1)!.title = "%"; } + const isBaseballFielding = isSport("baseball") && name === "Fielding"; + let footer: FooterRow[]; - if (isSport("baseball") && name === "Fielding") { + if (isBaseballFielding) { playerStats = expandFieldingStats({ rows: playerStats, stats, }); - footer = [ - { - data: expandFieldingStats({ - rows: [careerStats], - stats, - addDummyPosIndex: true, - }).map((object, i) => [ - i === 0 ? "Career" : null, - null, - null, - ...stats.map((stat) => formatStatGameHigh(object, stat)), - ]), - }, - ]; + footer = expandFieldingStats({ + rows: [careerStats], + stats, + addDummyPosIndex: true, + }).map((object, i) => ({ + data: [ + i === 0 ? "Career" : null, + null, + null, + ...stats.map((stat) => formatStatGameHigh(object, stat)), + ], + })); } else { footer = [ { @@ -307,13 +307,16 @@ export const StatsTable = ({ }); } + const showSelectSeasonRangeButton = + rangeFooter.state.type === "closed" && !isBaseballFielding; + return ( } /> - {rangeFooter.state.type === "closed" ? ( + {showSelectSeasonRangeButton ? (