Add Language dropdown to Preferences
This commit is contained in:
parent
3ae22ce8ee
commit
36447e4bf2
1 changed files with 16 additions and 6 deletions
|
@ -33,10 +33,11 @@ class Preferences extends ImmutablePureComponent {
|
||||||
settings: ImmutablePropTypes.map,
|
settings: ImmutablePropTypes.map,
|
||||||
};
|
};
|
||||||
|
|
||||||
onThemeChange = e => {
|
onSelectChange = path => {
|
||||||
const { dispatch } = this.props;
|
return e => {
|
||||||
dispatch(changeSetting(['themeMode'], e.target.value));
|
this.props.dispatch(changeSetting(path, e.target.value));
|
||||||
}
|
};
|
||||||
|
};
|
||||||
|
|
||||||
onDefaultPrivacyChange = e => {
|
onDefaultPrivacyChange = e => {
|
||||||
const { dispatch } = this.props;
|
const { dispatch } = this.props;
|
||||||
|
@ -51,10 +52,19 @@ class Preferences extends ImmutablePureComponent {
|
||||||
<SimpleForm>
|
<SimpleForm>
|
||||||
<FieldsGroup>
|
<FieldsGroup>
|
||||||
<SelectDropdown
|
<SelectDropdown
|
||||||
label='Theme mode'
|
label='Theme'
|
||||||
items={{ light: 'Light', dark: 'Dark' }}
|
items={{ light: 'Light', dark: 'Dark' }}
|
||||||
defaultValue={settings.get('themeMode')}
|
defaultValue={settings.get('themeMode')}
|
||||||
onChange={this.onThemeChange}
|
onChange={this.onSelectChange(['themeMode'])}
|
||||||
|
/>
|
||||||
|
</FieldsGroup>
|
||||||
|
|
||||||
|
<FieldsGroup>
|
||||||
|
<SelectDropdown
|
||||||
|
label='Language'
|
||||||
|
items={{ en: 'English', es: 'Español', fr: 'Français' }}
|
||||||
|
defaultValue={settings.get('language')}
|
||||||
|
onChange={this.onSelectChange(['locale'])}
|
||||||
/>
|
/>
|
||||||
</FieldsGroup>
|
</FieldsGroup>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue