Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

fix color pick type using react-color types (#1915)

Igor Dykhta38734422191b
diff --git a/src/components/side-panel/layer-panel/custom-picker.tsx b/src/components/side-panel/layer-panel/custom-picker.tsx
index 703bf0c47..115d2f7e3 100644
--- a/src/components/side-panel/layer-panel/custom-picker.tsx
+++ b/src/components/side-panel/layer-panel/custom-picker.tsx
@@ -20,27 +20,18 @@
import React, {Component} from 'react';
import styled, {withTheme} from 'styled-components';
-import {SketchPicker} from 'react-color';
+import {SketchPicker, ColorChangeHandler} from 'react-color';
import onClickOutside from 'react-onclickoutside';
import {createSelector} from 'reselect';
// This was put in because 3rd party library react-color doesn't yet cater for customized color of child component <SketchField> which contains HEX/RGB input text box
// Issue raised: https://github.com/casesandberg/react-color/issues/631
-type SketchPickerValue = {
- hsl: {h: number; s: number; l: number; a: number};
- hex: string;
- rgb: {r: number; g: number; b: number; a: number};
- hsv: {h: number; s: number; v: number; a: number};
- oldHue: number;
- source: string;
-};
-
type CustomPickerProps = {
color: string;
theme: {
panelBackground: string;
};
- onChange: (v: SketchPickerValue) => void;
+ onChange: ColorChangeHandler;
onSwatchClose: () => void;
};