feat: select line on checkbox container click (#732)

* feat: select line on checkbox container click

Closes #703

* Make onChange optional

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Thaïs
2023-07-18 19:00:48 +02:00
committed by GitHub
parent fdb2011a96
commit 5d4fad2d96
2 changed files with 9 additions and 13 deletions

View File

@ -6,7 +6,7 @@ import { IconCheck, IconMinus } from '@/ui/icon';
type OwnProps = {
checked: boolean;
indeterminate?: boolean;
onChange: (value: boolean) => void;
onChange?: (value: boolean) => void;
};
const StyledInputContainer = styled.div`
@ -71,7 +71,7 @@ export function Checkbox({ checked, onChange, indeterminate }: OwnProps) {
}, [checked]);
function handleChange(value: boolean) {
onChange(value);
onChange?.(value);
setIsInternalChecked(!isInternalChecked);
}