bigbuffet-rw/app/soapbox/features/compose/containers/search_results_container.js
marcin mikołajczak 403d6ae48c Search results improvements
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2021-08-07 20:42:39 +02:00

21 lines
818 B
JavaScript

import { connect } from 'react-redux';
import SearchResults from '../components/search_results';
import { fetchSuggestions, dismissSuggestion } from '../../../actions/suggestions';
import { expandSearch } from '../../../actions/search';
const mapStateToProps = state => {
return {
value: state.getIn(['search', 'submittedValue']),
results: state.getIn(['search', 'results']),
suggestions: state.getIn(['suggestions', 'items']),
submitted: state.getIn(['search', 'submitted']),
};
};
const mapDispatchToProps = dispatch => ({
fetchSuggestions: () => dispatch(fetchSuggestions()),
expandSearch: type => dispatch(expandSearch(type)),
dismissSuggestion: account => dispatch(dismissSuggestion(account.get('id'))),
});
export default connect(mapStateToProps, mapDispatchToProps)(SearchResults);