{"size": 405, "ext": "js", "max_stars_repo_path": "resources/js/actions/modals.js", "max_stars_repo_name": "cabolanoz/bongo", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "resources/js/actions/modals.js", "max_issues_repo_name": "cabolanoz/bongo", "max_issues_repo_issues_event_min_datetime": "2022-02-14T03:53:43.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T12:29:41.000Z", "max_forks_repo_path": "resources/js/actions/modals.js", "max_forks_repo_name": "cabolanoz/bongo", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 23.8235294118, "max_line_length": 81, "alphanum_fraction": 0.6592592593}
import { ModalName } from '../const';
import { MODAL_SHOW, MODAL_HIDE } from './types';

export const hideModal = dispatch => {
  dispatch({ type: MODAL_HIDE });
};

export const showModal = (dispatch, modal) => {
  if (!modal) {
    hideModal(dispatch);
  } else {
    dispatch({ type: MODAL_SHOW, data: modal });
  }
};

export const showSearchModal = dispatch => showModal(dispatch, ModalName.search);
