2016-11-13 07:04:18 -05:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import {
|
|
|
|
changeSearch,
|
2017-03-31 13:59:54 -04:00
|
|
|
clearSearch,
|
|
|
|
submitSearch,
|
|
|
|
showSearch
|
2016-11-13 07:04:18 -05:00
|
|
|
} from '../../../actions/search';
|
|
|
|
import Search from '../components/search';
|
|
|
|
|
|
|
|
const mapStateToProps = state => ({
|
|
|
|
value: state.getIn(['search', 'value'])
|
|
|
|
});
|
|
|
|
|
|
|
|
const mapDispatchToProps = dispatch => ({
|
|
|
|
|
|
|
|
onChange (value) {
|
|
|
|
dispatch(changeSearch(value));
|
|
|
|
},
|
|
|
|
|
|
|
|
onClear () {
|
2017-03-31 13:59:54 -04:00
|
|
|
dispatch(clearSearch());
|
2016-11-13 07:04:18 -05:00
|
|
|
},
|
|
|
|
|
2017-03-31 13:59:54 -04:00
|
|
|
onSubmit () {
|
|
|
|
dispatch(submitSearch());
|
2016-11-13 07:04:18 -05:00
|
|
|
},
|
|
|
|
|
2017-03-31 13:59:54 -04:00
|
|
|
onShow () {
|
|
|
|
dispatch(showSearch());
|
2016-11-13 07:04:18 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Search);
|