2021-08-05 17:18:16 +08:00
|
|
|
import { connect } from 'react-redux';
|
2021-10-07 23:47:39 -04:00
|
|
|
import * as SETTINGS from 'constants/settings';
|
2021-08-05 20:48:04 +08:00
|
|
|
import { doSetClientSetting } from 'redux/actions/settings';
|
2022-03-04 23:29:20 +08:00
|
|
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
2021-08-05 17:18:16 +08:00
|
|
|
import SettingAppearance from './view';
|
|
|
|
|
2021-08-05 20:48:04 +08:00
|
|
|
const select = (state) => ({
|
2022-06-28 17:01:19 -03:00
|
|
|
disableBackground: makeSelectClientSetting(SETTINGS.DISABLE_BACKGROUND)(state),
|
2021-08-05 20:48:04 +08:00
|
|
|
clock24h: makeSelectClientSetting(SETTINGS.CLOCK_24H)(state),
|
2021-08-05 21:16:10 +08:00
|
|
|
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
|
2021-08-08 10:26:40 +08:00
|
|
|
hideBalance: makeSelectClientSetting(SETTINGS.HIDE_BALANCE)(state),
|
2021-08-05 20:48:04 +08:00
|
|
|
});
|
2021-08-05 17:18:16 +08:00
|
|
|
|
2021-08-05 20:48:04 +08:00
|
|
|
const perform = (dispatch) => ({
|
|
|
|
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
2021-08-05 21:16:10 +08:00
|
|
|
setSearchInLanguage: (value) => dispatch(doSetClientSetting(SETTINGS.SEARCH_IN_LANGUAGE, value)),
|
2021-08-05 20:48:04 +08:00
|
|
|
});
|
2021-08-05 17:18:16 +08:00
|
|
|
|
|
|
|
export default connect(select, perform)(SettingAppearance);
|