Add Language dropdown to Preferences

This commit is contained in:
Alex Gleason 2020-06-04 18:32:46 -05:00
parent 3ae22ce8ee
commit 36447e4bf2
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -33,10 +33,11 @@ class Preferences extends ImmutablePureComponent {
settings: ImmutablePropTypes.map,
};
onThemeChange = e => {
const { dispatch } = this.props;
dispatch(changeSetting(['themeMode'], e.target.value));
}
onSelectChange = path => {
return e => {
this.props.dispatch(changeSetting(path, e.target.value));
};
};
onDefaultPrivacyChange = e => {
const { dispatch } = this.props;
@ -51,10 +52,19 @@ class Preferences extends ImmutablePureComponent {
<SimpleForm>
<FieldsGroup>
<SelectDropdown
label='Theme mode'
label='Theme'
items={{ light: 'Light', dark: 'Dark' }}
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>