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.

18 lines
746 B

7 years ago
7 years ago
7 years ago
  1. import { connect } from 'react-redux';
  2. import SearchResults from '../components/search_results';
  3. import { fetchSuggestions, dismissSuggestion } from 'mastodon/actions/suggestions';
  4. import { expandSearch } from 'mastodon/actions/search';
  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);