lbry-desktop/ui/component/syncToggle/index.js
jessop d9bf72a351 all settings constants come from redux
sync settings

backout nav cases and anon preference key

more robust backout header

put notificationSettings under backout bar

review changes
2020-07-27 11:53:14 -04:00

20 lines
796 B
JavaScript

import { SETTINGS } from 'lbry-redux';
import { connect } from 'react-redux';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import { selectGetSyncErrorMessage } from 'lbryinc';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import { doSetClientSetting } from 'redux/actions/settings';
import SyncToggle from './view';
const select = state => ({
syncEnabled: makeSelectClientSetting(SETTINGS.ENABLE_SYNC)(state),
verifiedEmail: selectUserVerifiedEmail(state),
getSyncError: selectGetSyncErrorMessage(state),
language: makeSelectClientSetting(SETTINGS.LANGUAGE)(state),
});
const perform = dispatch => ({
setSyncEnabled: value => dispatch(doSetClientSetting(SETTINGS.ENABLE_SYNC, value)),
});
export default connect(select, perform)(SyncToggle);