From c91aa836129f9e4a9cf579a1ee43911db668763f Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Wed, 4 Oct 2023 11:21:06 -0700 Subject: [PATCH] fix props --- src/components/CheckBoxTree/index.tsx | 21 ++++++++++++++++++--- src/components/ColorSwatch/index.tsx | 20 ++++++++++++++------ 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/components/CheckBoxTree/index.tsx b/src/components/CheckBoxTree/index.tsx index 15b581aa..3333bf43 100644 --- a/src/components/CheckBoxTree/index.tsx +++ b/src/components/CheckBoxTree/index.tsx @@ -7,6 +7,7 @@ import classNames from "classnames"; import { ChangeAgentsRenderingStateAction, + ColorChangesMap, SetVisibleAction, VisibilitySelectionMap, } from "../../state/selection/types"; @@ -41,7 +42,11 @@ interface CheckBoxTreeProps { payloadForSelectAll: VisibilitySelectionMap; payloadForSelectNone: VisibilitySelectionMap; isSharedCheckboxIndeterminate: boolean; - colorInfoForPicker: any; //TODO: type this + recentColors: string[]; //TODO: type this; + setColorInfoFromPicker: ( + colorChanges?: ColorChangesMap, + recentColors?: string[] + ) => void; } const CHECKBOX_SPAN_NO = 2; const LABEL_SPAN_NO = 6; @@ -216,7 +221,8 @@ class CheckBoxTree extends React.Component { agentsHighlighted, treeData, agentsChecked, - colorInfoForPicker, + recentColors, + setColorInfoFromPicker, } = this.props; return treeData.length > 0 ? (
@@ -258,7 +264,10 @@ class CheckBoxTree extends React.Component { color={nodeData.color} agentName={nodeData.title} tags={this.getAgentTags(nodeData.title)} - colorInfoForPicker={colorInfoForPicker} + recentColors={recentColors} + setColorInfoFromPicker={ + setColorInfoFromPicker + } /> { tags={[ value.value as string, ]} + recentColors={ + recentColors + } + setColorInfoFromPicker={ + setColorInfoFromPicker + } />