import React from 'react'; import { useField } from 'react-final-form'; import cn from 'classnames'; import { Flex } from 'indigo-react'; const ColorInput = ({ name, colors, disabled = false, label, className }) => { const { input } = useField(name, { subscription: { value: true } }); const isWhite = c => c.toUpperCase() === '#FFFFFF'; return ( {label} {colors.map(c => ( input.onChange(c)}> {c === input.value ? (
) : (
)} ))} ); }; export default ColorInput;