feat: multiple selected notes panel

This commit is contained in:
Baptiste Grob
2021-04-08 11:30:56 +02:00
parent 0f53361689
commit abfc588368
36 changed files with 542 additions and 128 deletions

View File

@@ -11,6 +11,7 @@ import '@reach/checkbox/styles.css';
export type SwitchProps = HTMLProps<HTMLInputElement> & {
checked?: boolean;
onChange: (checked: boolean) => void;
className?: string;
children: ComponentChildren;
};
@@ -19,8 +20,9 @@ export const Switch: FunctionalComponent<SwitchProps> = (
) => {
const [checkedState, setChecked] = useState(props.checked || false);
const checked = props.checked ?? checkedState;
const className = props.className ?? '';
return (
<label className="sn-component flex justify-between items-center cursor-pointer hover:bg-contrast py-2 px-3">
<label className={`sn-component flex justify-between items-center cursor-pointer hover:bg-contrast px-3 ${className}`}>
{props.children}
<CustomCheckboxContainer
checked={checked}
@@ -33,6 +35,7 @@ export const Switch: FunctionalComponent<SwitchProps> = (
<CustomCheckboxInput
{...({
...props,
className: undefined,
children: undefined,
} as CustomCheckboxInputProps)}
/>