interface: plumb disabled to colorinput

This commit is contained in:
Matilde Park 2020-10-07 14:29:51 -04:00
parent 25cfc6c612
commit 45e83439d5

View File

@ -15,10 +15,11 @@ import { uxToHex, hexToUx } from "~/logic/lib/util";
type ColorInputProps = Parameters<typeof Col>[0] & {
id: string;
label: string;
disabled: boolean;
};
export function ColorInput(props: ColorInputProps) {
const { id, label, caption, ...rest } = props;
const { id, label, caption, disabled, ...rest } = props;
const [{ value, onBlur }, meta, { setValue }] = useField(id);
const hex = value.substr(2).replace(".", "");
@ -50,6 +51,7 @@ export function ColorInput(props: ColorInputProps) {
onBlur={onBlur}
onChange={onChange}
value={hex}
disabled={disabled || false}
/>
<Box
borderBottomRightRadius={1}