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