{"size": 1216, "ext": "js", "max_stars_repo_path": "src/features/apparel/components/ApparelSearchContainer.js", "max_stars_repo_name": "rrsilaya/bluetag-client", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/features/apparel/components/ApparelSearchContainer.js", "max_issues_repo_name": "rrsilaya/bluetag-client", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/features/apparel/components/ApparelSearchContainer.js", "max_forks_repo_name": "rrsilaya/bluetag-client", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.5185185185, "max_line_length": 76, "alphanum_fraction": 0.6611842105}
import { connect } from 'react-redux';
import ApparelSearch from './ApparelSearch';

import {
  changeSearch,
  changeSelect,
  changeOrder,
  searchApparel,
  filterApparel,
  filterClassification,
  toggleAdd
} from '../../entities/apparel';

const mapStateToProps = state => {
  const { searchApparel, page, addModal } = state.apparel;

  return {
    searchApparel,
    page,
    addModal
  };
};

const mapDispatchToProps = dispatch => {
  return {
    handleChangeSearch: value => {
      dispatch(changeSearch(value));
    },
    handleChangeSelect: (name, value) => {
      dispatch(changeSelect(name, value));
    },
    handleChangeOrder: value => {
      dispatch(changeOrder(value));
    },
    handleSearchApparel: (page, search) => {
      dispatch(searchApparel(page, search));
    },
    handleFilterApparel: (page, search) => {
      dispatch(filterApparel(page, search));
    },
    handleFilterClassification: (page, search) => {
      dispatch(filterClassification(page, search));
    },
    handleToggleAdd: () => {
      dispatch(toggleAdd());
    }
  };
};

const ApparelSearchContainer = connect(mapStateToProps, mapDispatchToProps)(
  ApparelSearch
);
export default ApparelSearchContainer;
