logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

search_container.js (651B)


  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);