import React from 'react' import enhanceWithClickOutside from 'react-click-outside' import { TwitterPicker } from 'react-color' class ColorPicker extends React.Component { constructor() { super() this.state = { isVisible: false } this.toggle = this.toggle.bind(this) this.handlePickColor = this.handlePickColor.bind(this) } toggle() { this.setState({ isVisible: !this.state.isVisible }) } handleClickOutside() { this.setState({ isVisible: false }) } handlePickColor(color) { this.setState({ isVisible: false }) this.props.onChange(color.hex) } render() { return (
BG
) } } export default enhanceWithClickOutside(ColorPicker)