{"size": 752, "ext": "js", "max_stars_repo_path": "src/reducers/credentialReducer.js", "max_stars_repo_name": "Fitness-Anywhere/frontend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/reducers/credentialReducer.js", "max_issues_repo_name": "Fitness-Anywhere/frontend", "max_issues_repo_issues_event_min_datetime": "2021-03-10T16:53:43.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T04:04:29.000Z", "max_forks_repo_path": "src/reducers/credentialReducer.js", "max_forks_repo_name": "Fitness-Anywhere/frontend", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 4, "max_forks_count": null, "avg_line_length": 19.7894736842, "max_line_length": 69, "alphanum_fraction": 0.522606383}
import { initialValues } from "./initialValues";

export const credentialReducer = (state = initialValues, action) => {
  switch (action.type) {
    case "CREATING_NEW_PROFILE":
      return {
        ...state,
        loading: true,
      };
    case "SOMETHING_WENT_WRONG":
      return {
        ...state,
        loading: false,
        error: action.payload,
      };

    // log in
    case "LOGGING_IN_USER":
      return {
        ...state,
        loading: true,
      };
    case "USER_LOGGED_IN_SUCCESSFULLY":
      return {
        ...state,
        loading: false,
      };
    case "ERROR_LOGING_IN":
      return {
        ...state,
        loading: false,
        error: action.payload,
      };
    default:
      return state;
  }
};
