fix: queue color picker not working

This commit is contained in:
canove
2021-01-14 09:57:24 -03:00
parent 812b5046e1
commit 973c0b8a77
3 changed files with 28 additions and 19 deletions

View File

@@ -1,8 +1,9 @@
import { Dialog } from "@material-ui/core";
import React, { useState } from "react";
import { GithubPicker } from "react-color";
const ColorPicker = ({ onChange, currentColor }) => {
const ColorPicker = ({ onChange, currentColor, handleClose, open }) => {
const [color, setColor] = useState(currentColor);
const handleChange = color => {
@@ -10,7 +11,11 @@ const ColorPicker = ({ onChange, currentColor }) => {
};
return (
<div>
<Dialog
onClose={handleClose}
aria-labelledby="simple-dialog-title"
open={open}
>
<GithubPicker
width={"100%"}
triangle="hide"
@@ -18,7 +23,7 @@ const ColorPicker = ({ onChange, currentColor }) => {
onChange={handleChange}
onChangeComplete={color => onChange(color.hex)}
/>
</div>
</Dialog>
);
};