diff options
Diffstat (limited to 'app/assets/javascripts/components/features/compose/containers')
-rw-r--r-- | app/assets/javascripts/components/features/compose/containers/search_container.jsx | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/app/assets/javascripts/components/features/compose/containers/search_container.jsx b/app/assets/javascripts/components/features/compose/containers/search_container.jsx new file mode 100644 index 000000000..17a68f2fc --- /dev/null +++ b/app/assets/javascripts/components/features/compose/containers/search_container.jsx @@ -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); |