2019-04-20 13:18:26 -04:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import SearchResults from '../components/search_results';
|
2019-08-31 06:53:10 -04:00
|
|
|
import { fetchSuggestions, dismissSuggestion } from 'flavours/glitch/actions/suggestions';
|
|
|
|
import { expandSearch } from 'flavours/glitch/actions/search';
|
2019-04-20 13:18:26 -04:00
|
|
|
|
|
|
|
const mapStateToProps = state => ({
|
|
|
|
results: state.getIn(['search', 'results']),
|
2018-10-22 18:08:39 -04:00
|
|
|
suggestions: state.getIn(['suggestions', 'items']),
|
2019-06-27 15:12:26 -04:00
|
|
|
searchTerm: state.getIn(['search', 'searchTerm']),
|
2019-04-20 13:18:26 -04:00
|
|
|
});
|
|
|
|
|
2018-10-22 18:08:39 -04:00
|
|
|
const mapDispatchToProps = dispatch => ({
|
|
|
|
fetchSuggestions: () => dispatch(fetchSuggestions()),
|
2019-07-26 23:49:50 -04:00
|
|
|
expandSearch: type => dispatch(expandSearch(type)),
|
2018-10-22 18:08:39 -04:00
|
|
|
dismissSuggestion: account => dispatch(dismissSuggestion(account.get('id'))),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(SearchResults);
|