mirror of
https://github.com/kikobar/mastodon.git
synced 2024-11-20 06:07:36 +00:00
36 lines
706 B
React
36 lines
706 B
React
|
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);
|