2019-09-04 23:43:37 +02:00
|
|
|
import { connect } from 'react-redux';
|
2020-07-10 23:04:36 +02:00
|
|
|
import { SETTINGS } from 'lbry-redux';
|
2020-10-15 19:56:55 +02:00
|
|
|
import { doSetLanguage, doSetClientSetting } from 'redux/actions/settings';
|
2019-10-03 18:55:21 +02:00
|
|
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
2019-09-04 23:43:37 +02:00
|
|
|
import SettingLanguage from './view';
|
|
|
|
|
|
|
|
const select = state => ({
|
|
|
|
language: makeSelectClientSetting(SETTINGS.LANGUAGE)(state),
|
2020-10-15 19:56:55 +02:00
|
|
|
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
|
2019-09-04 23:43:37 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
2019-11-05 19:54:58 +01:00
|
|
|
setLanguage: value => dispatch(doSetLanguage(value)),
|
2020-10-15 19:56:55 +02:00
|
|
|
setSearchInLanguage: value => dispatch(doSetClientSetting(SETTINGS.SEARCH_IN_LANGUAGE, value)),
|
2019-09-04 23:43:37 +02:00
|
|
|
});
|
|
|
|
|
2020-07-10 23:04:36 +02:00
|
|
|
export default connect(select, perform)(SettingLanguage);
|