const intialState = {
  onProgress: false,
  shouldCreateActivity: false,
};

const clearState = { onProgress: false, shouldCreateActivity: false };

export default (state = intialState, action) => {
  switch (action.type) {
    case "ENABLE_CREATE_ACTIVITY":
      return { ...state, shouldCreateActivity: true };
    case "DISABLE_CREATE_ACTIVITY":
      return { ...state, shouldCreateActivity: false };
    case "CLEAR_COMMON_FLAGS":
      return clearState;
    default:
      return state;
  }
};
