2017-04-01 04:59:54 +11:00
|
|
|
import { connect } from 'react-redux';
|
2023-05-24 01:15:17 +10:00
|
|
|
|
2019-07-27 13:49:50 +10:00
|
|
|
import { expandSearch } from 'mastodon/actions/search';
|
2023-05-24 01:15:17 +10:00
|
|
|
import { fetchSuggestions, dismissSuggestion } from 'mastodon/actions/suggestions';
|
|
|
|
|
|
|
|
import SearchResults from '../components/search_results';
|
2017-04-01 04:59:54 +11:00
|
|
|
|
|
|
|
const mapStateToProps = state => ({
|
2017-05-21 01:31:47 +10:00
|
|
|
results: state.getIn(['search', 'results']),
|
2018-10-23 09:08:39 +11:00
|
|
|
suggestions: state.getIn(['suggestions', 'items']),
|
2019-06-29 03:29:11 +10:00
|
|
|
searchTerm: state.getIn(['search', 'searchTerm']),
|
2017-04-01 04:59:54 +11:00
|
|
|
});
|
|
|
|
|
2018-10-23 09:08:39 +11:00
|
|
|
const mapDispatchToProps = dispatch => ({
|
|
|
|
fetchSuggestions: () => dispatch(fetchSuggestions()),
|
2019-07-27 13:49:50 +10:00
|
|
|
expandSearch: type => dispatch(expandSearch(type)),
|
2018-10-23 09:08:39 +11:00
|
|
|
dismissSuggestion: account => dispatch(dismissSuggestion(account.get('id'))),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(SearchResults);
|