Renamed userEmail... to userField...
This commit is contained in:
parent
c52c75758b
commit
b9b7af2bbd
8 changed files with 29 additions and 29 deletions
|
@ -1,8 +1,8 @@
|
|||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { doUserEmailNew, doUserInviteNew } from 'redux/actions/user';
|
||||
import { doUserFieldNew, doUserInviteNew } from 'redux/actions/user';
|
||||
import { selectEmailNewIsPending, selectEmailNewErrorMessage } from 'redux/selectors/user';
|
||||
import UserEmailNew from './view';
|
||||
import UserFieldNew from './view';
|
||||
|
||||
const select = state => ({
|
||||
isPending: selectEmailNewIsPending(state),
|
||||
|
@ -10,7 +10,7 @@ const select = state => ({
|
|||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
addUserEmail: email => dispatch(doUserEmailNew(email)),
|
||||
addUserEmail: email => dispatch(doUserFieldNew(email)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(UserEmailNew);
|
||||
export default connect(select, perform)(UserFieldNew);
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import { Form, FormRow, Submit } from 'component/form.js';
|
||||
|
||||
class UserEmailNew extends React.PureComponent {
|
||||
class UserFieldNew extends React.PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
|
@ -52,4 +52,4 @@ class UserEmailNew extends React.PureComponent {
|
|||
}
|
||||
}
|
||||
|
||||
export default UserEmailNew;
|
||||
export default UserFieldNew;
|
|
@ -1,12 +1,12 @@
|
|||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { doUserEmailVerify, doUserEmailVerifyFailure } from 'redux/actions/user';
|
||||
import { doUserFieldVerify, doUserFieldVerifyFailure } from 'redux/actions/user';
|
||||
import {
|
||||
selectEmailVerifyIsPending,
|
||||
selectEmailToVerify,
|
||||
selectEmailVerifyErrorMessage,
|
||||
} from 'redux/selectors/user';
|
||||
import UserEmailVerify from './view';
|
||||
import UserFieldVerify from './view';
|
||||
|
||||
const select = state => ({
|
||||
isPending: selectEmailVerifyIsPending(state),
|
||||
|
@ -15,8 +15,8 @@ const select = state => ({
|
|||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
verifyUserEmail: (code, recaptcha) => dispatch(doUserEmailVerify(code, recaptcha)),
|
||||
verifyUserEmailFailure: error => dispatch(doUserEmailVerifyFailure(error)),
|
||||
verifyUserEmail: (code, recaptcha) => dispatch(doUserFieldVerify(code, recaptcha)),
|
||||
verifyUserEmailFailure: error => dispatch(doUserFieldVerifyFailure(error)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(UserEmailVerify);
|
||||
export default connect(select, perform)(UserFieldVerify);
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||
import Link from 'component/link';
|
||||
import { Form, FormRow, Submit } from 'component/form.js';
|
||||
|
||||
class UserEmailVerify extends React.PureComponent {
|
||||
class UserFieldVerify extends React.PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
|
@ -59,4 +59,4 @@ class UserEmailVerify extends React.PureComponent {
|
|||
}
|
||||
}
|
||||
|
||||
export default UserEmailVerify;
|
||||
export default UserFieldVerify;
|
|
@ -12,7 +12,7 @@ import { Provider } from 'react-redux';
|
|||
import { doConditionalAuthNavigate, doDaemonReady, doShowSnackBar } from 'redux/actions/app';
|
||||
import { doNavigate } from 'redux/actions/navigation';
|
||||
import { doDownloadLanguages } from 'redux/actions/settings';
|
||||
import { doUserEmailVerify } from 'redux/actions/user';
|
||||
import { doUserFieldVerify } from 'redux/actions/user';
|
||||
import 'scss/all.scss';
|
||||
import store from 'store';
|
||||
import app from './app';
|
||||
|
@ -35,7 +35,7 @@ ipcRenderer.on('open-uri-requested', (event, uri, newSession) => {
|
|||
}
|
||||
if (verification.token && verification.recaptcha) {
|
||||
app.store.dispatch(doConditionalAuthNavigate(newSession));
|
||||
app.store.dispatch(doUserEmailVerify(verification.token, verification.recaptcha));
|
||||
app.store.dispatch(doUserFieldVerify(verification.token, verification.recaptcha));
|
||||
} else {
|
||||
app.store.dispatch(doShowSnackBar({ message: 'Invalid Verification URI' }));
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import React from 'react';
|
||||
import { Modal } from 'modal/modal';
|
||||
import Link from 'component/link/index';
|
||||
import UserEmailNew from 'component/userEmailNew';
|
||||
import UserEmailVerify from 'component/userEmailVerify';
|
||||
import UserFieldNew from 'component/userFieldNew';
|
||||
import UserFieldVerify from 'component/userFieldVerify';
|
||||
|
||||
class ModalPhoneCollection extends React.PureComponent {
|
||||
renderInner() {
|
||||
|
@ -11,9 +11,9 @@ class ModalPhoneCollection extends React.PureComponent {
|
|||
const cancelButton = <Link button="text" onClick={closeModal} label={__('Not Now')} />;
|
||||
|
||||
if (!user.has_verified_email && !email) {
|
||||
return <UserEmailNew cancelButton={cancelButton} />;
|
||||
return <UserFieldNew cancelButton={cancelButton} />;
|
||||
} else if (!user.has_verified_email) {
|
||||
return <UserEmailVerify cancelButton={cancelButton} />;
|
||||
return <UserFieldVerify cancelButton={cancelButton} />;
|
||||
}
|
||||
closeModal();
|
||||
}
|
||||
|
@ -27,9 +27,9 @@ class ModalPhoneCollection extends React.PureComponent {
|
|||
}
|
||||
|
||||
return (
|
||||
<Modal type="custom" isOpen contentLabel="Email">
|
||||
<Modal type="custom" isOpen contentLabel="Phone">
|
||||
<section>
|
||||
<h3 className="modal__header">Can We Stay In Touch?</h3>
|
||||
<h3 className="modal__header">Verify Your Phone</h3>
|
||||
{this.renderInner()}
|
||||
</section>
|
||||
</Modal>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import React from 'react';
|
||||
import { BusyMessage } from 'component/common';
|
||||
import Link from 'component/link';
|
||||
import UserEmailNew from 'component/userEmailNew';
|
||||
import UserEmailVerify from 'component/userEmailVerify';
|
||||
import UserFieldNew from 'component/userFieldNew';
|
||||
import UserFieldVerify from 'component/userFieldVerify';
|
||||
import UserVerify from 'component/userVerify';
|
||||
|
||||
export class AuthPage extends React.PureComponent {
|
||||
|
@ -45,9 +45,9 @@ export class AuthPage extends React.PureComponent {
|
|||
if (isPending) {
|
||||
return [<BusyMessage message={__('Authenticating')} />, true];
|
||||
} else if (user && !user.has_verified_email && !email) {
|
||||
return [<UserEmailNew />, true];
|
||||
return [<UserFieldNew />, true];
|
||||
} else if (user && !user.has_verified_email) {
|
||||
return [<UserEmailVerify />, true];
|
||||
return [<UserFieldVerify />, true];
|
||||
} else if (user && !user.is_identity_verified) {
|
||||
return [<UserVerify />, false];
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ export function doUserFetch() {
|
|||
};
|
||||
}
|
||||
|
||||
export function doUserEmailNew(email) {
|
||||
export function doUserFieldNew(email) {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
type: ACTIONS.USER_EMAIL_NEW_STARTED,
|
||||
|
@ -116,14 +116,14 @@ export function doUserEmailNew(email) {
|
|||
};
|
||||
}
|
||||
|
||||
export function doUserEmailVerifyFailure(error) {
|
||||
export function doUserFieldVerifyFailure(error) {
|
||||
return {
|
||||
type: ACTIONS.USER_EMAIL_VERIFY_FAILURE,
|
||||
data: { error },
|
||||
};
|
||||
}
|
||||
|
||||
export function doUserEmailVerify(verificationToken, recaptcha) {
|
||||
export function doUserFieldVerify(verificationToken, recaptcha) {
|
||||
return (dispatch, getState) => {
|
||||
const email = selectEmailToVerify(getState());
|
||||
|
||||
|
@ -154,7 +154,7 @@ export function doUserEmailVerify(verificationToken, recaptcha) {
|
|||
throw new Error('Your email is still not verified.'); // shouldn't happen
|
||||
}
|
||||
})
|
||||
.catch(error => dispatch(doUserEmailVerifyFailure(error)));
|
||||
.catch(error => dispatch(doUserFieldVerifyFailure(error)));
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue