1import React from 'react';
2import { useField } from 'react-final-form';
3import cn from 'classnames';
4import { Flex } from 'indigo-react';
6const ColorInput = ({ name, colors, disabled = false, label, className }) => {
7 const { input } = useField(name, { subscription: { value: true } });
9 const isWhite = c => c.toUpperCase() === '#FFFFFF';
12 <Flex col className={cn(className, 'flex-wrap mb1')}>
15 className={cn('f6 lh-tall', {
22 <Flex.Item as={Flex} wrap>
28 className={cn('m0 p0 h7 w7 p2 flex flex-center', {
29 'b b-black': isWhite(c),
31 style={{ backgroundColor: c }}
32 onClick={() => input.onChange(c)}>
33 {c === input.value ? (
36 { 'bg-black': isWhite(c), 'bg-white': !isWhite(c) },
50export default ColorInput;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list