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",
"indentWithTabs": "Tab character",
"indentUnit": "Tab size (when using spaces)",
"spellChecker": "Spell checking"
"spellcheck": "Spell checking"
}
},
"embeddings": {

View file

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

View file

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