From ae3d71e61cab88afd4ba78eeecfcb143d9c97cab Mon Sep 17 00:00:00 2001 From: Jeremy Scheff Date: Mon, 15 Jul 2024 22:57:42 -0400 Subject: [PATCH] Switch to checkboxes --- TODO | 11 +++++--- src/ui/views/AdvancedPlayerSearch.tsx | 39 ++++++++++++++++----------- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/TODO b/TODO index 9a98f6468..d5562ca24 100644 --- a/TODO +++ b/TODO @@ -5,9 +5,8 @@ advanced player search https://old.reddit.com/r/BasketballGM/comments/1d0xctc/vi - more concise URLs - convert object to array for filters - columns - user picks one of the stat table types, or ratings table - - switch from select to checkboxes, so you can select none? - - implement similar to player graphs - - make sure it works in URL on ctrl+r + - implement bios + - make sure game highs work - form UI - select custom filters - categories @@ -982,6 +981,12 @@ customizable columns https://discord.com/channels/@me/914986660020748321 - define "standard" columns available in some context (like "career total" or "individual season") - deal with instability in the current column selection system - like if # of columns changes (sometimes due to season change), selection gets lost - start gradually porting over some views +- new ideas + - global category/key column definition, link to header and how to retrieve from player object + - this would simplify logic for when i return a list of ratings/stats to show as columns, or more complex stuff like getExtraStatTypeKeys + - handle special formatting (like +/-) + - handle supercols + - who defines the columns fetched? UI or worker? don't want to over fetch... dropbox integration - save league to cloud - add way to view leagues saved in dropbox account and select one from that list diff --git a/src/ui/views/AdvancedPlayerSearch.tsx b/src/ui/views/AdvancedPlayerSearch.tsx index d14126279..0fbf41e06 100644 --- a/src/ui/views/AdvancedPlayerSearch.tsx +++ b/src/ui/views/AdvancedPlayerSearch.tsx @@ -415,22 +415,29 @@ const ShowStatTypes = ({ return ( <> - + {allStatTypes.map(x => { + const id = `AdvancedPlayerSearchStatType-${x.key}`; + return ( +
+ { + if (event.target.checked) { + setShowStatTypes([...showStatTypes, x.key as string]); + } else { + setShowStatTypes(showStatTypes.filter(y => y !== x.key)); + } + }} + /> + +
+ ); + })} ); };