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

22 lines
979 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 { selectClientSetting } from 'redux/selectors/settings';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import SettingAppearance from './view';
2021-08-05 14:48:04 +02:00
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),
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);