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, 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>