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