mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-06-02 22:26:57 -05:00
Stop showing more selects once enough scores
This commit is contained in:
parent
8410898372
commit
38e4add466
|
|
@ -40,6 +40,15 @@ export function MapList({ mapList, canSubmitScore, groupIds }: MapListProps) {
|
|||
setWinners(newWinners);
|
||||
};
|
||||
|
||||
const selectInvisible = (index: number) => {
|
||||
if (scoreValid(winners, mapList.length) && winners.length <= index) {
|
||||
return true;
|
||||
}
|
||||
if (index > winners.length) return true;
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
return (
|
||||
<ol className="play-match__stages">
|
||||
<h2 className="play-match__map-list-header">Map list</h2>
|
||||
|
|
@ -55,7 +64,7 @@ export function MapList({ mapList, canSubmitScore, groupIds }: MapListProps) {
|
|||
{canSubmitScore && (
|
||||
<select
|
||||
className={clsx("play-match__select", {
|
||||
invisible: i > winners.length,
|
||||
invisible: selectInvisible(i),
|
||||
})}
|
||||
onChange={(e) => updateWinners(e.target.value, i)}
|
||||
value={winners[i] ?? NO_RESULT}
|
||||
|
|
@ -83,7 +92,6 @@ function Submitter({
|
|||
mapList: MapListProps["mapList"];
|
||||
winners: string[];
|
||||
}) {
|
||||
// TODO: not properly handling scores getting reported after conclusion
|
||||
const warningText = scoreValid(winners, mapList.length)
|
||||
? undefined
|
||||
: "Report more maps to submit the score";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user