{"size": 1472, "ext": "js", "max_stars_repo_path": "app/containers/SettingsPage.js", "max_stars_repo_name": "OstVoj/Electron_altX", "max_stars_repo_stars_event_min_datetime": "2020-07-13T14:47:59.000Z", "max_stars_repo_stars_event_max_datetime": "2020-07-13T14:47:59.000Z", "max_issues_repo_path": "app/containers/SettingsPage.js", "max_issues_repo_name": "Sim923/Electron_altX", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/containers/SettingsPage.js", "max_forks_repo_name": "Sim923/Electron_altX", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.131147541, "max_line_length": 60, "alphanum_fraction": 0.6161684783}
// @flow
import { connect } from "react-redux";
import { SETTINGS } from "../reducers/types";
import Settings from "../components/Settings";

function mapStateToProps(state) {
  return {
    app: state.app,
    theme: state.settings.theme,
    navigation: state.settings.navigation,
    duration: state.settings.duration,
    maxProfile: state.settings.maxProfile,
    changed: state.settings.changed,
    gsearch: state.settings.gsearch,
    youtube: state.settings.youtube,
    targets: state.settings.targets
  };
}

function mapDispatchToProps(dispatch) {
  return {
    setTheme: theme => {
      dispatch({ type: SETTINGS.SETTHEME, theme });
    },
    setNavigation: nav => {
      dispatch({ type: SETTINGS.SETNAVIGATION, nav });
    },
    changeDuration: (ros, which, value) => {
      dispatch({
        type: SETTINGS.SETDURATION,
        ros,
        which,
        value
      });
    },
    setMaxProfile: value => {
      dispatch({ type: SETTINGS.SETMAXPROFILE, value });
    },
    setCheck: (which, value) => {
      dispatch({ type: SETTINGS.SETCHECK, which, value });
    },
    changeAll: (duration, maxProfile, gsearch, youtube) => {
      dispatch({
        type: SETTINGS.CHANGEALL,
        duration,
        maxProfile,
        gsearch,
        youtube
      });
    },
    setTargets: targets => {
      dispatch({ type: SETTINGS.SETTARGETS, targets });
    }
  };
}

export default connect(
  mapStateToProps,
  mapDispatchToProps
)(Settings);
