refactor: select for bool

This commit is contained in:
cha0s 2021-01-30 20:10:14 -06:00
parent 0e5b5ec2ae
commit 33be5cb110

View File

@ -26,16 +26,19 @@ const Literal = ({
const patch = useJsonPatcher(); const patch = useJsonPatcher();
const valueComponent = (path, type, {value}) => { const valueComponent = (path, type, {value}) => {
switch (type) { switch (type) {
case 'bool': case 'bool': {
return ( return (
<input <select
type="checkbox"
onChange={(event) => { onChange={(event) => {
onChange(event, event.target.checked, path); onChange(event, event.target.value, path);
}} }}
value={null === value ? false : value} value={null === value ? false : value}
/> >
<option value={false}>false</option>
<option value>true</option>
</select>
); );
}
case 'expressions': case 'expressions':
return ( return (
<Expressions <Expressions