lbry-desktop/ui/component/userEmailNew/index.js
Sean Yesmunt 2677cd17d8
new signin/signup (#3960)
* new signin/signup

* cleanup and password reset

* new flow working

* cleanup

* add 'autoComplete' props

* fix prop

* try to call email/confirm before resetting password

* Dont use password reset token for email confirmation.

* add password reset

* password manager improvements

* update lbryinc

* cleanup

* slightly improve close button on sign up page

* moar fixes

* fix password autofil

Co-authored-by: Mark Beamer Jr <markbeamerjr@gmail.com>
2020-04-13 15:16:07 -04:00

31 lines
1.2 KiB
JavaScript

import * as SETTINGS from 'constants/settings';
import { connect } from 'react-redux';
import {
selectEmailNewIsPending,
selectEmailNewErrorMessage,
selectEmailAlreadyExists,
doUserSignUp,
doClearEmailEntry,
} from 'lbryinc';
import { DAEMON_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),
});
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);