blob: eb052fb8a6f8036db41bfae8d0a68d99cc7f83f3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import { connect } from 'react-redux';
import { RouteComponentProps, withRouter } from 'react-router';
import SelectLanguage from '../components/SelectLanguage';
import withAppContext, { IAppContext } from '../context';
import { IReduxState, ReduxDispatch } from '../redux/store';
const mapStateToProps = (state: IReduxState) => ({
preferredLocale: state.settings.guiSettings.preferredLocale,
});
const mapDispatchToProps = (_dispatch: ReduxDispatch, props: RouteComponentProps & IAppContext) => {
return {
preferredLocalesList: props.app.getPreferredLocaleList(),
setPreferredLocale(locale: string) {
props.app.setPreferredLocale(locale);
props.history.goBack();
},
onClose() {
props.history.goBack();
},
};
};
export default withAppContext(
withRouter(connect(mapStateToProps, mapDispatchToProps)(SelectLanguage)),
);
|