1
0
REI-Fixed/app/assets/javascripts/components/features/compose/containers/search_container.jsx

36 lines
648 B
React
Raw Normal View History

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