wip colors
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import React, {useCallback, useContext, useState} from "react";
|
||||
import {ColorPreset} from "../models/Colors";
|
||||
import DialogContext from "../contexts/DialogContext";
|
||||
import {DialogType} from "../models/Dialog";
|
||||
|
||||
interface ColorDialogProps {
|
||||
data?: ColorPreset
|
||||
}
|
||||
|
||||
export default function ColorDialog({data}: ColorDialogProps) {
|
||||
const {setDialog} = useContext(DialogContext);
|
||||
|
||||
const [name, setName] = useState(data?.name || "");
|
||||
const [hue, setHue] = useState(data?.value?.h || 0);
|
||||
const [sat, setSat] = useState(data?.value?.s || 0);
|
||||
const [kelvin, setKelvin] = useState(data?.value?.kelvin || 0);
|
||||
|
||||
const onClose = useCallback(() => {
|
||||
setDialog({type: DialogType.None});
|
||||
}, [setDialog]);
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user