Search component
This commit is contained in:
parent
8152584cf5
commit
f0bdfadab7
8 changed files with 291 additions and 4 deletions
|
@ -0,0 +1,35 @@
|
|||
import { connect } from 'react-redux';
|
||||
import {
|
||||
changeSearch,
|
||||
clearSearchSuggestions,
|
||||
fetchSearchSuggestions,
|
||||
resetSearch
|
||||
} from '../../../actions/search';
|
||||
import Search from '../components/search';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
suggestions: state.getIn(['search', 'suggestions']),
|
||||
value: state.getIn(['search', 'value'])
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
|
||||
onChange (value) {
|
||||
dispatch(changeSearch(value));
|
||||
},
|
||||
|
||||
onClear () {
|
||||
dispatch(clearSearchSuggestions());
|
||||
},
|
||||
|
||||
onFetch (value) {
|
||||
dispatch(fetchSearchSuggestions(value));
|
||||
},
|
||||
|
||||
onReset () {
|
||||
dispatch(resetSearch());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(Search);
|
Loading…
Add table
Add a link
Reference in a new issue