2017-04-01 02:59:54 +09:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import SearchResults from '../components/search_results';
|
2018-10-23 07:08:39 +09:00
|
|
|
import { fetchSuggestions, dismissSuggestion } from '../../../actions/suggestions';
|
2017-04-01 02:59:54 +09:00
|
|
|
|
|
|
|
const mapStateToProps = state => ({
|
2017-05-21 00:31:47 +09:00
|
|
|
results: state.getIn(['search', 'results']),
|
2018-10-23 07:08:39 +09:00
|
|
|
suggestions: state.getIn(['suggestions', 'items']),
|
2017-04-01 02:59:54 +09:00
|
|
|
});
|
|
|
|
|
2018-10-23 07:08:39 +09:00
|
|
|
const mapDispatchToProps = dispatch => ({
|
|
|
|
fetchSuggestions: () => dispatch(fetchSuggestions()),
|
|
|
|
dismissSuggestion: account => dispatch(dismissSuggestion(account.get('id'))),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(SearchResults);
|