Fix formatting
parent
3c2bb6e4f6
commit
db5bc0cb7a
|
@ -33,14 +33,15 @@ interface SpellCheckLanguagesDropdownIProps {
|
||||||
className: string,
|
className: string,
|
||||||
value: string,
|
value: string,
|
||||||
onOptionChange(language: string),
|
onOptionChange(language: string),
|
||||||
};
|
}
|
||||||
|
|
||||||
interface SpellCheckLanguagesDropdownIState {
|
interface SpellCheckLanguagesDropdownIState {
|
||||||
searchQuery: string,
|
searchQuery: string,
|
||||||
languages: any,
|
languages: any,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class SpellCheckLanguagesDropdown extends React.Component<SpellCheckLanguagesDropdownIProps, SpellCheckLanguagesDropdownIState> {
|
export default class SpellCheckLanguagesDropdown extends React.Component<SpellCheckLanguagesDropdownIProps,
|
||||||
|
SpellCheckLanguagesDropdownIState> {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this._onSearchChange = this._onSearchChange.bind(this);
|
this._onSearchChange = this._onSearchChange.bind(this);
|
||||||
|
@ -58,7 +59,7 @@ export default class SpellCheckLanguagesDropdown extends React.Component<SpellCh
|
||||||
if (a > b) return 1;
|
if (a > b) return 1;
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
var langs = [];
|
const langs = [];
|
||||||
languages.forEach((language) => {
|
languages.forEach((language) => {
|
||||||
langs.push({
|
langs.push({
|
||||||
label: language,
|
label: language,
|
||||||
|
|
|
@ -22,12 +22,12 @@ import {_t} from "../../../languageHandler";
|
||||||
interface ExistingSpellCheckLanguageIProps {
|
interface ExistingSpellCheckLanguageIProps {
|
||||||
language: string,
|
language: string,
|
||||||
onRemoved(language: string),
|
onRemoved(language: string),
|
||||||
};
|
}
|
||||||
|
|
||||||
interface SpellCheckLanguagesIProps {
|
interface SpellCheckLanguagesIProps {
|
||||||
languages: Array<string>,
|
languages: Array<string>,
|
||||||
onLanguagesChange(languages: Array<string>),
|
onLanguagesChange(languages: Array<string>),
|
||||||
};
|
}
|
||||||
|
|
||||||
interface SpellCheckLanguagesIState {
|
interface SpellCheckLanguagesIState {
|
||||||
newLanguage: string,
|
newLanguage: string,
|
||||||
|
@ -89,7 +89,7 @@ export default class SpellCheckLanguages extends React.Component<SpellCheckLangu
|
||||||
return <ExistingSpellCheckLanguage language={e} onRemoved={this._onRemoved} key={e} />;
|
return <ExistingSpellCheckLanguage language={e} onRemoved={this._onRemoved} key={e} />;
|
||||||
});
|
});
|
||||||
|
|
||||||
let addButton = (
|
const addButton = (
|
||||||
<AccessibleButton onClick={this._onAddClick} kind="primary">
|
<AccessibleButton onClick={this._onAddClick} kind="primary">
|
||||||
{_t("Add")}
|
{_t("Add")}
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
|
@ -99,12 +99,13 @@ export default class SpellCheckLanguages extends React.Component<SpellCheckLangu
|
||||||
<div className="mx_SpellCheckLanguages">
|
<div className="mx_SpellCheckLanguages">
|
||||||
{existingSpellCheckLanguages}
|
{existingSpellCheckLanguages}
|
||||||
<form onSubmit={this._onAddClick} noValidate={true}>
|
<form onSubmit={this._onAddClick} noValidate={true}>
|
||||||
<SpellCheckLanguagesDropdown className="mx_GeneralUserSettingsTab_spellCheckLanguageInput"
|
<SpellCheckLanguagesDropdown
|
||||||
|
className="mx_GeneralUserSettingsTab_spellCheckLanguageInput"
|
||||||
value={this.state.newLanguage}
|
value={this.state.newLanguage}
|
||||||
onOptionChange={this._onNewLanguageChange} />
|
onOptionChange={this._onNewLanguageChange} />
|
||||||
{addButton}
|
{addButton}
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ import ProfileSettings from "../../ProfileSettings";
|
||||||
import * as languageHandler from "../../../../../languageHandler";
|
import * as languageHandler from "../../../../../languageHandler";
|
||||||
import SettingsStore from "../../../../../settings/SettingsStore";
|
import SettingsStore from "../../../../../settings/SettingsStore";
|
||||||
import LanguageDropdown from "../../../elements/LanguageDropdown";
|
import LanguageDropdown from "../../../elements/LanguageDropdown";
|
||||||
import SpellCheckSettings from "../../SpellCheckSettings"
|
import SpellCheckSettings from "../../SpellCheckSettings";
|
||||||
import AccessibleButton from "../../../elements/AccessibleButton";
|
import AccessibleButton from "../../../elements/AccessibleButton";
|
||||||
import DeactivateAccountDialog from "../../../dialogs/DeactivateAccountDialog";
|
import DeactivateAccountDialog from "../../../dialogs/DeactivateAccountDialog";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
@ -186,7 +186,7 @@ export default class GeneralUserSettingsTab extends React.Component {
|
||||||
|
|
||||||
_onSpellCheckLanguagesChange = (languages) => {
|
_onSpellCheckLanguagesChange = (languages) => {
|
||||||
SettingsStore.setValue("spell-check-languages", null, SettingLevel.DEVICE, languages);
|
SettingsStore.setValue("spell-check-languages", null, SettingLevel.DEVICE, languages);
|
||||||
this.setState({spellCheckLanguages: languages})
|
this.setState({spellCheckLanguages: languages});
|
||||||
|
|
||||||
languageHandler.setSpellCheckLanguages(languages);
|
languageHandler.setSpellCheckLanguages(languages);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue