diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-03-31 19:59:54 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-03-31 21:11:09 +0200 |
commit | b4046c5957f16437910cdfe1ab45ee818118e7d7 (patch) | |
tree | 0d6d394a4c4f0401aa198c2410a8479d4f199958 /app/assets/javascripts/components/features/compose/containers | |
parent | 553e6dd07cec7c74083841dd572269cbaa66dffb (diff) |
Rework search
Diffstat (limited to 'app/assets/javascripts/components/features/compose/containers')
-rw-r--r-- | app/assets/javascripts/components/features/compose/containers/search_container.jsx | 17 | ||||
-rw-r--r-- | app/assets/javascripts/components/features/compose/containers/search_results_container.jsx | 8 |
2 files changed, 16 insertions, 9 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 index 17a68f2fc..96709215a 100644 --- a/app/assets/javascripts/components/features/compose/containers/search_container.jsx +++ b/app/assets/javascripts/components/features/compose/containers/search_container.jsx @@ -1,14 +1,13 @@ import { connect } from 'react-redux'; import { changeSearch, - clearSearchSuggestions, - fetchSearchSuggestions, - resetSearch + clearSearch, + submitSearch, + showSearch } from '../../../actions/search'; import Search from '../components/search'; const mapStateToProps = state => ({ - suggestions: state.getIn(['search', 'suggestions']), value: state.getIn(['search', 'value']) }); @@ -19,15 +18,15 @@ const mapDispatchToProps = dispatch => ({ }, onClear () { - dispatch(clearSearchSuggestions()); + dispatch(clearSearch()); }, - onFetch (value) { - dispatch(fetchSearchSuggestions(value)); + onSubmit () { + dispatch(submitSearch()); }, - onReset () { - dispatch(resetSearch()); + onShow () { + dispatch(showSearch()); } }); diff --git a/app/assets/javascripts/components/features/compose/containers/search_results_container.jsx b/app/assets/javascripts/components/features/compose/containers/search_results_container.jsx new file mode 100644 index 000000000..e5911fd38 --- /dev/null +++ b/app/assets/javascripts/components/features/compose/containers/search_results_container.jsx @@ -0,0 +1,8 @@ +import { connect } from 'react-redux'; +import SearchResults from '../components/search_results'; + +const mapStateToProps = state => ({ + results: state.getIn(['search', 'results']) +}); + +export default connect(mapStateToProps)(SearchResults); |