feat: Add "Appearance" pane to preferences (#816)
Co-authored-by: Mo <mo@standardnotes.com>
This commit is contained in:
@@ -84,7 +84,7 @@ const getDefaultEditor = (application: WebApplication) => {
|
||||
|
||||
export const Defaults: FunctionComponent<Props> = ({ application }) => {
|
||||
const [editorItems, setEditorItems] = useState<DropdownItem[]>([]);
|
||||
const [defaultEditorValue] = useState(
|
||||
const [defaultEditorValue, setDefaultEditorValue] = useState(
|
||||
() =>
|
||||
getDefaultEditor(application)?.package_info?.identifier || 'plain-editor'
|
||||
);
|
||||
@@ -128,6 +128,7 @@ export const Defaults: FunctionComponent<Props> = ({ application }) => {
|
||||
}, [application]);
|
||||
|
||||
const setDefaultEditor = (value: string) => {
|
||||
setDefaultEditorValue(value as FeatureIdentifier);
|
||||
const editors = application.componentManager.componentsForArea(
|
||||
ComponentArea.Editor
|
||||
);
|
||||
@@ -155,7 +156,7 @@ export const Defaults: FunctionComponent<Props> = ({ application }) => {
|
||||
id="def-editor-dropdown"
|
||||
label="Select the default editor"
|
||||
items={editorItems}
|
||||
defaultValue={defaultEditorValue}
|
||||
value={defaultEditorValue}
|
||||
onChange={setDefaultEditor}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user