import { HorizontalSeparator } from '@/Components/Shared/HorizontalSeparator' import { Switch } from '@/Components/Switch/Switch' import { PreferencesGroup, PreferencesSegment, Subtitle, Text, Title, } from '@/Components/Preferences/PreferencesComponents' import { WebApplication } from '@/UIModels/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, true), ) const [marginResizers, setMarginResizers] = useState(() => application.getPreference(PrefKey.EditorResizersEnabled, true), ) const toggleMonospaceFont = () => { setMonospaceFont(!monospaceFont) application.setPreference(PrefKey.EditorMonospaceEnabled, !monospaceFont).catch(console.error) } const toggleMarginResizers = () => { setMarginResizers(!marginResizers) application.setPreference(PrefKey.EditorResizersEnabled, !marginResizers).catch(console.error) } return ( Tools
Monospace Font Toggles the font style in the Plain Text editor.
Margin Resizers Allows left and right editor margins to be resized.
) })