Added sign in errors and logos.
This commit is contained in:
@@ -6,39 +6,23 @@ const INITIAL_STATE = {
|
||||
},
|
||||
bodyshop: null,
|
||||
fingerprint: null,
|
||||
signingIn: false,
|
||||
error: null,
|
||||
conflict: false,
|
||||
passwordreset: {
|
||||
email: null,
|
||||
error: null,
|
||||
success: false,
|
||||
},
|
||||
};
|
||||
|
||||
const userReducer = (state = INITIAL_STATE, action) => {
|
||||
switch (action.type) {
|
||||
// case UserActionTypes.VALIDATE_PASSWORD_RESET_START:
|
||||
// case UserActionTypes.SEND_PASSWORD_RESET_EMAIL_START:
|
||||
// return {
|
||||
// ...state,
|
||||
// passwordreset: {
|
||||
// email: action.payload,
|
||||
// error: null,
|
||||
// success: false,
|
||||
// },
|
||||
// };
|
||||
// case UserActionTypes.VALIDATE_PASSWORD_RESET_FAILURE:
|
||||
// case UserActionTypes.SEND_PASSWORD_RESET_EMAIL_FAILURE:
|
||||
// return { ...state, passwordreset: { error: action.payload } };
|
||||
// case UserActionTypes.VALIDATE_PASSWORD_RESET_SUCCESS:
|
||||
// case UserActionTypes.SEND_PASSWORD_RESET_EMAIL_SUCCESS:
|
||||
// return {
|
||||
// ...state,
|
||||
// passwordreset: { ...state.passwordreset, success: true },
|
||||
// };
|
||||
case UserActionTypes.EMAIL_SIGN_IN_START:
|
||||
return {
|
||||
...state,
|
||||
signingIn: true,
|
||||
error: null,
|
||||
};
|
||||
case UserActionTypes.SIGN_IN_SUCCESS:
|
||||
return {
|
||||
...state,
|
||||
signingIn: false,
|
||||
currentUser: action.payload,
|
||||
error: null,
|
||||
};
|
||||
@@ -54,11 +38,7 @@ const userReducer = (state = INITIAL_STATE, action) => {
|
||||
error: null,
|
||||
currentUser: { authorized: false },
|
||||
};
|
||||
// case UserActionTypes.SET_USER_LANGUAGE:
|
||||
// return {
|
||||
// ...state,
|
||||
// language: action.payload,
|
||||
// };
|
||||
|
||||
case UserActionTypes.UPDATE_USER_DETAILS_SUCCESS:
|
||||
return {
|
||||
...state,
|
||||
@@ -75,6 +55,7 @@ const userReducer = (state = INITIAL_STATE, action) => {
|
||||
case UserActionTypes.EMAIL_SIGN_UP_FAILURE:
|
||||
return {
|
||||
...state,
|
||||
signingIn: false,
|
||||
error: action.payload,
|
||||
};
|
||||
default:
|
||||
|
||||
@@ -26,3 +26,8 @@ export const selectPasswordReset = createSelector(
|
||||
[selectUser],
|
||||
(user) => user.passwordreset
|
||||
);
|
||||
|
||||
export const selectSigningIn = createSelector(
|
||||
[selectUser],
|
||||
(user) => user.signingIn
|
||||
);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
const UserActionTypes = {
|
||||
SET_CURRENT_USER: "SET_CURRENT_USER",
|
||||
GOOGLE_SIGN_IN_START: "GOOGLE_SIGN_IN_START",
|
||||
SIGN_IN_SUCCESS: "SIGN_IN_SUCCESS",
|
||||
SIGN_IN_FAILURE: "SIGN_IN_FAILURE",
|
||||
EMAIL_SIGN_IN_START: "EMAIL_SIGN_IN_START",
|
||||
|
||||
Reference in New Issue
Block a user