search_results_container.js 748 B

1234567891011121314151617181920
  1. import { connect } from 'react-redux';
  2. import { expandSearch } from 'mastodon/actions/search';
  3. import { fetchSuggestions, dismissSuggestion } from 'mastodon/actions/suggestions';
  4. import SearchResults from '../components/search_results';
  5. const mapStateToProps = state => ({
  6. results: state.getIn(['search', 'results']),
  7. suggestions: state.getIn(['suggestions', 'items']),
  8. searchTerm: state.getIn(['search', 'searchTerm']),
  9. });
  10. const mapDispatchToProps = dispatch => ({
  11. fetchSuggestions: () => dispatch(fetchSuggestions()),
  12. expandSearch: type => dispatch(expandSearch(type)),
  13. dismissSuggestion: account => dispatch(dismissSuggestion(account.get('id'))),
  14. });
  15. export default connect(mapStateToProps, mapDispatchToProps)(SearchResults);