Skip to content

Commit

Permalink
fix color pick type using react-color types (#1915)
Browse files Browse the repository at this point in the history
  • Loading branch information
igorDykhta committed Aug 10, 2022
1 parent f739a49 commit 3873442
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/components/side-panel/layer-panel/custom-picker.tsx
Expand Up @@ -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;
};

Expand Down

0 comments on commit 3873442

Please sign in to comment.