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