2021-08-05 11:18:16 +02:00
|
|
|
import { connect } from 'react-redux';
|
2021-10-17 10:36:14 +02:00
|
|
|
import * as SETTINGS from 'constants/settings';
|
2021-08-05 14:48:04 +02:00
|
|
|
import { doSetClientSetting } from 'redux/actions/settings';
|
2022-02-26 06:18:10 +01:00
|
|
|
import { selectClientSetting } from 'redux/selectors/settings';
|
2021-08-08 04:26:40 +02:00
|
|
|
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
2021-08-05 11:18:16 +02:00
|
|
|
import SettingAppearance from './view';
|
|
|
|
|
2021-08-05 14:48:04 +02:00
|
|
|
const select = (state) => ({
|
2021-11-23 05:29:04 +01:00
|
|
|
clock24h: selectClientSetting(state, SETTINGS.CLOCK_24H),
|
|
|
|
searchInLanguage: selectClientSetting(state, SETTINGS.SEARCH_IN_LANGUAGE),
|
2021-08-08 04:26:40 +02:00
|
|
|
isAuthenticated: selectUserVerifiedEmail(state),
|
2021-11-23 05:29:04 +01:00
|
|
|
hideBalance: selectClientSetting(state, SETTINGS.HIDE_BALANCE),
|
2022-03-31 16:19:19 +02:00
|
|
|
hideTitleNotificationCount: selectClientSetting(state, SETTINGS.HIDE_TITLE_NOTIFICATION_COUNT),
|
2021-08-05 14:48:04 +02:00
|
|
|
});
|
2021-08-05 11:18:16 +02:00
|
|
|
|
2021-08-05 14:48:04 +02:00
|
|
|
const perform = (dispatch) => ({
|
|
|
|
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
2021-08-05 15:16:10 +02:00
|
|
|
setSearchInLanguage: (value) => dispatch(doSetClientSetting(SETTINGS.SEARCH_IN_LANGUAGE, value)),
|
2021-08-05 14:48:04 +02:00
|
|
|
});
|
2021-08-05 11:18:16 +02:00
|
|
|
|
|
|
|
export default connect(select, perform)(SettingAppearance);
|