lbry-desktop/ui/component/userEmailNew/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

31 lines
1.2 KiB
JavaScript

import { connect } from 'react-redux';
import { doClearEmailEntry, doUserSignUp } from 'redux/actions/user';
import {
selectEmailNewIsPending,
selectEmailNewErrorMessage,
selectEmailAlreadyExists,
selectUser,
} from 'redux/selectors/user';
import { DAEMON_SETTINGS, SETTINGS } from 'lbry-redux';
import { doSetClientSetting, doSetDaemonSetting } from 'redux/actions/settings';
import { makeSelectClientSetting, selectDaemonSettings } from 'redux/selectors/settings';
import UserEmailNew from './view';
const select = state => ({
isPending: selectEmailNewIsPending(state),
errorMessage: selectEmailNewErrorMessage(state),
syncEnabled: makeSelectClientSetting(SETTINGS.ENABLE_SYNC)(state),
daemonSettings: selectDaemonSettings(state),
emailExists: selectEmailAlreadyExists(state),
user: selectUser(state),
});
const perform = dispatch => ({
setSync: value => dispatch(doSetClientSetting(SETTINGS.ENABLE_SYNC, value)),
setShareDiagnosticData: shouldShareData =>
dispatch(doSetDaemonSetting(DAEMON_SETTINGS.SHARE_USAGE_DATA, shouldShareData)),
doSignUp: (email, password) => dispatch(doUserSignUp(email, password)),
clearEmailEntry: () => dispatch(doClearEmailEntry()),
});
export default connect(select, perform)(UserEmailNew);