1import React from 'react';
2import cn from 'classnames';
4import Flex from './Flex';
5import LinkButton from './LinkButton';
6import { useField } from 'react-final-form';
8export default function ToggleInput({
13 inverseColor = 'black',
24 meta: { submitting, submitSucceeded },
25 } = useField(name, { type: 'checkbox' });
27 disabled = disabled || submitting || submitSucceeded;
36 pointerEvents: 'none',
37 cursor: 'not-allowed',
40 {/* we totally hide the checkbox itself */}
44 className={cn('super-hidden')}
49 {/* and then display a prettier one in its stead */}
53 className={cn('f6 pv2 lh-tall us-none flex-row align-center', {
62 black: !input.checked,
63 [inverseColor]: input.checked,
65 {input.checked ? inverseLabel : label}
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