Skip to content

Commit

Permalink
Add Boolean support for BZDB settings
Browse files Browse the repository at this point in the history
  • Loading branch information
allejo committed May 2, 2022
1 parent 476ba7b commit 704e4a7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Components/Modals/BZDBSettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { BZDBSettingsModalOpenEventName } from '../../Events/IBZDBSettingsModalO
import { documentState } from '../../atoms';
import { BZDBType } from '../../data/bzdb-types';
import Button from '../Button';
import CheckboxField from '../Form/CheckboxField';
import NumberField from '../Form/NumberField';
import ListenerModal from '../ListenerModal';
import Markdown from '../Markdown';
Expand Down Expand Up @@ -36,6 +37,15 @@ const SettingEditor = ({ variable }: SettingEditorProps) => {
labelProps={{ className: 'sr-only' }}
/>
);
} else if (type === 'boolean') {
return (
<CheckboxField
label={variable.name}
onChange={setValue}
value={value}
labelProps={{ className: 'sr-only' }}
/>
);
}

return 'Unsupported';
Expand Down

0 comments on commit 704e4a7

Please sign in to comment.