diff --git a/web/modals/threads/color-picker.react.js b/web/modals/threads/color-picker.react.js deleted file mode 100644 --- a/web/modals/threads/color-picker.react.js +++ /dev/null @@ -1,78 +0,0 @@ -// @flow - -import * as React from 'react'; -import { type ColorResult, ChromePicker } from 'react-color'; - -import css from '../../style.css'; - -type Props = { - +id: string, - +value: string, - +disabled: boolean, - +onChange: (hex: string) => void, -}; -type State = { - +pickerOpen: boolean, -}; - -class ColorPicker extends React.PureComponent { - constructor(props: Props) { - super(props); - this.state = { - pickerOpen: false, - }; - } - - render(): React.Node { - let picker = null; - if (this.state.pickerOpen && !this.props.disabled) { - picker = ( -
- -
- ); - } - const style = { backgroundColor: `#${this.props.value}` }; - return ( -
-
-
-
-
- {picker} -
- ); - } - - onPickerKeyDown: ( - event: SyntheticKeyboardEvent, - ) => void = event => { - if (event.key === 'Escape') { - this.setState({ pickerOpen: false }); - } - }; - - onChangeColor: (color: ColorResult) => void = color => { - this.props.onChange(color.hex.substring(1, 7)); - }; - - onClick: () => void = () => { - this.setState({ pickerOpen: true }); - }; - - onBlur: () => void = () => { - this.setState({ pickerOpen: false }); - }; -} - -export default ColorPicker; diff --git a/web/style.css b/web/style.css --- a/web/style.css +++ b/web/style.css @@ -193,43 +193,6 @@ color: red; } -div.color-picker-container { - outline: none; - position: relative; -} -div.color-picker-button { - margin: 6px 3px; - overflow: hidden; - cursor: pointer; - padding: 4px; - display: inline-block; - border: solid 1px darkgray; - background: #eee; - color: #333; - vertical-align: middle; - border-radius: 3px; -} -div.color-picker-preview { - width: 25px; - height: 16px; - border: solid 1px #222; - margin-right: 5px; - float: left; - z-index: 0; -} -div.color-picker-down-symbol { - padding: 1px 0; - height: 16px; - line-height: 16px; - float: left; - font-size: 10px; -} -div.color-picker-selector { - position: absolute; - left: 4px; - top: 34px; -} - @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1),