1import React from 'react';
2import cn from 'classnames';
4import Flex from './Flex';
5import { useField } from 'react-final-form';
7export default function CheckboxInput({
20 meta: { submitting, submitSucceeded },
21 } = useField(name, { type: 'checkbox' });
23 disabled = disabled || submitting || submitSucceeded;
29 className={cn(className, {
36 pointerEvents: 'none',
37 cursor: 'not-allowed',
40 {/* we totally hide the checkbox itself */}
41 <Flex.Item as="input" className="super-hidden" id={name} {...input} />
42 {/* and then display a prettier one in its stead */}
48 'f6 lh-tall us-none pointer flex-row align-center'
54 className={cn('b1 p1', {
58 'bg-black white b-black': !disabled && (input.checked || white),
59 'bg-white black b-black': !disabled && !input.checked,
66 {input.checked && '✓'}
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