lbry-desktop/ui/component/settingAppearance/index.js

20 lines
864 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import * as SETTINGS from 'constants/settings';
2021-08-05 14:48:04 +02:00
import { doSetClientSetting } from 'redux/actions/settings';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import SettingAppearance from './view';
2021-08-05 14:48:04 +02:00
const select = (state) => ({
disableBackground: makeSelectClientSetting(SETTINGS.DISABLE_BACKGROUND)(state),
2021-08-05 14:48:04 +02:00
clock24h: makeSelectClientSetting(SETTINGS.CLOCK_24H)(state),
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
hideBalance: makeSelectClientSetting(SETTINGS.HIDE_BALANCE)(state),
2021-08-05 14:48:04 +02:00
});
2021-08-05 14:48:04 +02:00
const perform = (dispatch) => ({
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
setSearchInLanguage: (value) => dispatch(doSetClientSetting(SETTINGS.SEARCH_IN_LANGUAGE, value)),
2021-08-05 14:48:04 +02:00
});
export default connect(select, perform)(SettingAppearance);