lbry-desktop/ui/component/settingAppearance/index.js
2022-03-31 10:23:31 -04:00

21 lines
979 B
JavaScript

import { connect } from 'react-redux';
import * as SETTINGS from 'constants/settings';
import { doSetClientSetting } from 'redux/actions/settings';
import { selectClientSetting } from 'redux/selectors/settings';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import SettingAppearance from './view';
const select = (state) => ({
clock24h: selectClientSetting(state, SETTINGS.CLOCK_24H),
searchInLanguage: selectClientSetting(state, SETTINGS.SEARCH_IN_LANGUAGE),
isAuthenticated: selectUserVerifiedEmail(state),
hideBalance: selectClientSetting(state, SETTINGS.HIDE_BALANCE),
hideTitleNotificationCount: selectClientSetting(state, SETTINGS.HIDE_TITLE_NOTIFICATION_COUNT),
});
const perform = (dispatch) => ({
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
setSearchInLanguage: (value) => dispatch(doSetClientSetting(SETTINGS.SEARCH_IN_LANGUAGE, value)),
});
export default connect(select, perform)(SettingAppearance);