Use editor-preference-select for spell check (#694)

This commit is contained in:
mrdrogdrog 2020-10-28 11:32:44 +01:00 committed by GitHub
parent 5197d0512b
commit 819b36a137
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 12 deletions

View file

@ -386,7 +386,7 @@
"keyMap": "Keymap", "keyMap": "Keymap",
"indentWithTabs": "Tab character", "indentWithTabs": "Tab character",
"indentUnit": "Tab size (when using spaces)", "indentUnit": "Tab size (when using spaces)",
"spellChecker": "Spell checking" "spellcheck": "Spell checking"
} }
}, },
"embeddings": { "embeddings": {

View file

@ -7,7 +7,8 @@ export enum EditorPreferenceProperty {
KEYMAP = 'keyMap', KEYMAP = 'keyMap',
THEME = 'theme', THEME = 'theme',
INDENT_WITH_TABS = 'indentWithTabs', INDENT_WITH_TABS = 'indentWithTabs',
INDENT_UNIT = 'indentUnit' INDENT_UNIT = 'indentUnit',
SPELL_CHECK= 'spellcheck'
} }
export interface EditorPreferenceSelectProps { export interface EditorPreferenceSelectProps {

View file

@ -2,7 +2,7 @@ import { EditorConfiguration } from 'codemirror'
import equal from 'fast-deep-equal' import equal from 'fast-deep-equal'
import React, { Fragment, useCallback, useState } from 'react' import React, { Fragment, useCallback, useState } from 'react'
import { Button, Form, ListGroup } from 'react-bootstrap' import { Button, Form, ListGroup } from 'react-bootstrap'
import { Trans, useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { useSelector } from 'react-redux' import { useSelector } from 'react-redux'
import { ApplicationState } from '../../../../../redux' import { ApplicationState } from '../../../../../redux'
import { setEditorPreferences } from '../../../../../redux/editor/methods' import { setEditorPreferences } from '../../../../../redux/editor/methods'
@ -55,15 +55,10 @@ export const EditorPreferences: React.FC = () => {
<EditorPreferenceSelect onChange={sendPreferences} preferences={preferences} property={EditorPreferenceProperty.INDENT_UNIT}/> <EditorPreferenceSelect onChange={sendPreferences} preferences={preferences} property={EditorPreferenceProperty.INDENT_UNIT}/>
</ListGroup.Item> </ListGroup.Item>
<ListGroup.Item> <ListGroup.Item>
<Form.Group controlId='editorSpellChecker'> <EditorPreferenceSelect onChange={() => alert('This feature is not yet implemented.')} preferences={preferences} property={EditorPreferenceProperty.SPELL_CHECK}>
<Form.Label> <option value='off'>off</option>
<Trans i18nKey='editor.modal.preferences.spellChecker'/> <option value='en'>English</option>
</Form.Label> </EditorPreferenceSelect>
<Form.Control as='select' size='sm' onChange={() => alert('This feature is not yet implemented.')}>
<option value='off'>off</option>
<option value='en'>English</option>
</Form.Control>
</Form.Group>
</ListGroup.Item> </ListGroup.Item>
</ListGroup> </ListGroup>
</Form> </Form>