import { HorizontalSeparator } from '@/components/shared/HorizontalSeparator'; import { Switch } from '@/components/Switch'; import { PreferencesGroup, PreferencesSegment, Subtitle, Text, Title, } from '@/preferences/components'; import { WebApplication } from '@/ui_models/application'; import { PrefKey } from '@standardnotes/snjs'; import { observer } from 'mobx-react-lite'; import { FunctionalComponent } from 'preact'; import { useState } from 'preact/hooks'; type Props = { application: WebApplication; }; export const Tools: FunctionalComponent = observer( ({ application }: Props) => { const [monospaceFont, setMonospaceFont] = useState(() => application.getPreference(PrefKey.EditorMonospaceEnabled) ); const [marginResizers, setMarginResizers] = useState(() => application.getPreference(PrefKey.EditorResizersEnabled) ); const [spellcheck, setSpellcheck] = useState(() => application.getPreference(PrefKey.EditorSpellcheck) ); const toggleMonospaceFont = () => { setMonospaceFont(!monospaceFont); application.setPreference(PrefKey.EditorMonospaceEnabled, !monospaceFont); }; const toggleMarginResizers = () => { setMarginResizers(!marginResizers); application.setPreference(PrefKey.EditorResizersEnabled, !marginResizers); }; const toggleSpellcheck = () => { setSpellcheck(!spellcheck); application.setPreference(PrefKey.EditorSpellcheck, !spellcheck); }; return ( Tools
Monospace Font Toggles the font style in the Plain Text editor.
Margin Resizers Allows left and right editor margins to be resized.
Spellcheck May degrade performance, especially with long notes. Available in the Plain Text editor and most specialty editors.
); } );