You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
651 B

7 years ago
7 years ago
7 years ago
7 years ago
  1. import { connect } from 'react-redux';
  2. import {
  3. changeSearch,
  4. clearSearch,
  5. submitSearch,
  6. showSearch,
  7. } from '../../../actions/search';
  8. import Search from '../components/search';
  9. const mapStateToProps = state => ({
  10. value: state.getIn(['search', 'value']),
  11. submitted: state.getIn(['search', 'submitted']),
  12. });
  13. const mapDispatchToProps = dispatch => ({
  14. onChange (value) {
  15. dispatch(changeSearch(value));
  16. },
  17. onClear () {
  18. dispatch(clearSearch());
  19. },
  20. onSubmit () {
  21. dispatch(submitSearch());
  22. },
  23. onShow () {
  24. dispatch(showSearch());
  25. },
  26. });
  27. export default connect(mapStateToProps, mapDispatchToProps)(Search);