diff --git a/src/components/SeekGraph/SeekGraphLegend.tsx b/src/components/SeekGraph/SeekGraphLegend.tsx index 29ad4e264e..39ee1ccec1 100644 --- a/src/components/SeekGraph/SeekGraphLegend.tsx +++ b/src/components/SeekGraph/SeekGraphLegend.tsx @@ -71,15 +71,6 @@ export function SeekGraphLegend(props: SeekGraphLegendProps): JSX.Element { const group1 = [ legendItem(_("19x19"), () => BoardSizeLegendIcon(currentPalette.size19), "show19x19"), - legendItem(_("13x13"), () => BoardSizeLegendIcon(currentPalette.size13), "show13x13"), - legendItem(_("9x9"), () => BoardSizeLegendIcon(currentPalette.size9), "show9x9"), - legendItem( - _("Other"), - () => BoardSizeLegendIcon(currentPalette.sizeOther), - "showOtherSizes", - ), - ]; - const group2 = [ legendItem( _("Ranked"), () => @@ -94,6 +85,14 @@ export function SeekGraphLegend(props: SeekGraphLegendProps): JSX.Element { }), "showRanked", ), + legendItem( + _("Handicap"), + () => BoardSizeLegendIcon(currentPalette.handicap), + "showHandicap", + ), + ]; + const group2 = [ + legendItem(_("13x13"), () => BoardSizeLegendIcon(currentPalette.size13), "show13x13"), legendItem( _("Unranked"), () => @@ -108,6 +107,14 @@ export function SeekGraphLegend(props: SeekGraphLegendProps): JSX.Element { }), "showUnranked", ), + legendItem( + _("Other"), + () => BoardSizeLegendIcon(currentPalette.sizeOther), + "showOtherSizes", + ), + ]; + const group3 = [ + legendItem(_("9x9"), () => BoardSizeLegendIcon(currentPalette.size9), "show9x9"), legendItem( _("Rengo"), () => @@ -135,6 +142,7 @@ export function SeekGraphLegend(props: SeekGraphLegendProps): JSX.Element {
{group1}
{group2}
+
{group3}
diff --git a/src/components/SeekGraph/SeekGraphPalettes.tsx b/src/components/SeekGraph/SeekGraphPalettes.tsx index bf3756f64b..746db3c34c 100644 --- a/src/components/SeekGraph/SeekGraphPalettes.tsx +++ b/src/components/SeekGraph/SeekGraphPalettes.tsx @@ -27,6 +27,7 @@ export interface SeekGraphColorPalette { size13: ChallengePointStyle; size9: ChallengePointStyle; sizeOther: ChallengePointStyle; + handicap: ChallengePointStyle; // UNRANKED: ChallengePointStyle; ineligible: ChallengePointStyle; user: ChallengePointStyle; @@ -43,6 +44,7 @@ export class SeekGraphPalettes { size13: { fill: "#f000d0aa", stroke: "#ff60dd" }, size9: { fill: "#009090aa", stroke: "#00ffff" }, sizeOther: { fill: "#d06000aa", stroke: "#ff9000" }, + handicap: { fill: "#d1cb0faa", stroke: "#fff712" }, // UNRANKED: { fill: "#d06000", stroke: "#ff9000" }, ineligible: { fill: "#6b6b6baa", stroke: "#bbb" }, user: { fill: "#ed1f1faa", stroke: "#e37495" }, @@ -57,6 +59,7 @@ export class SeekGraphPalettes { size13: { fill: "#ff60ddaa", stroke: "#f000d0" }, size9: { fill: "#00ffffaa", stroke: "#009090" }, sizeOther: { fill: "#ff9000aa", stroke: "#d06000" }, + handicap: { fill: "#fff712aa", stroke: "#d1cb0f" }, // UNRANKED: { fill: "#d06000", stroke: "#ff9000" }, ineligible: { fill: "#bbbbbbaa", stroke: "#6b6b6b" }, user: { fill: "#e37495aa", stroke: "#ed1f1f" }, @@ -71,6 +74,7 @@ export class SeekGraphPalettes { size13: { fill: "#cc73a8aa", stroke: "#cc73a8" }, size9: { fill: "#55b2ebaa", stroke: "#55b2eb" }, sizeOther: { fill: "#d55b00aa", stroke: "#d55b00" }, + handicap: { fill: "#d55b00aa", stroke: "#d55b00" }, // UNRANKED: { fill: "#d06000", stroke: "#ff9000" }, ineligible: { fill: "#bbbbbbaa", stroke: "#bbb" }, user: { fill: "#e6a100aa", stroke: "#e6a100" }, diff --git a/src/lib/challenge_utils.tsx b/src/lib/challenge_utils.tsx index ccb23a8a49..afd75ffd74 100644 --- a/src/lib/challenge_utils.tsx +++ b/src/lib/challenge_utils.tsx @@ -31,6 +31,7 @@ export interface ChallengeFilter { show9x9: boolean; showOtherSizes: boolean; showRengo: boolean; + showHandicap: boolean; } export type ChallengeFilterKey = keyof ChallengeFilter; @@ -49,5 +50,6 @@ export function shouldDisplayChallenge(c: Challenge, filter: ChallengeFilter): b (filter.showUnranked && !c.ranked && !c.rengo) || (filter.showRanked && c.ranked) || (filter.showRengo && c.rengo); - return (c.eligible || filter.showIneligible) && matchesRanked && matchesSize; + const matchesHandicap = filter.showHandicap || c.handicap === 0; + return (c.eligible || filter.showIneligible) && matchesRanked && matchesSize && matchesHandicap; }