mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 00:54:43 -04:00
Use editor-preference-select for spell check (#694)
This commit is contained in:
parent
5197d0512b
commit
819b36a137
3 changed files with 8 additions and 12 deletions
|
@ -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": {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue