diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-04-20 17:50:12 +0200 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2019-04-22 20:15:47 +0200 |
commit | ab3e8fc542f53ce9c7a8d1b39ae57bdb60667dac (patch) | |
tree | 9bba48373483f7306e92576b4f1a1beb6ee16f14 /app/javascript/flavours/glitch/features/compose/containers | |
parent | c92ab35b1925647ef8f7f3d6df6a667becc0271c (diff) |
Move DrawerSearch to Search + SearchContainer
Diffstat (limited to 'app/javascript/flavours/glitch/features/compose/containers')
-rw-r--r-- | app/javascript/flavours/glitch/features/compose/containers/search_container.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/features/compose/containers/search_container.js b/app/javascript/flavours/glitch/features/compose/containers/search_container.js new file mode 100644 index 000000000..8f4bfcf08 --- /dev/null +++ b/app/javascript/flavours/glitch/features/compose/containers/search_container.js @@ -0,0 +1,35 @@ +import { connect } from 'react-redux'; +import { + changeSearch, + clearSearch, + submitSearch, + showSearch, +} from 'flavours/glitch/actions/search'; +import Search from '../components/search'; + +const mapStateToProps = state => ({ + value: state.getIn(['search', 'value']), + submitted: state.getIn(['search', 'submitted']), +}); + +const mapDispatchToProps = dispatch => ({ + + onChange (value) { + dispatch(changeSearch(value)); + }, + + onClear () { + dispatch(clearSearch()); + }, + + onSubmit () { + dispatch(submitSearch()); + }, + + onShow () { + dispatch(showSearch()); + }, + +}); + +export default connect(mapStateToProps, mapDispatchToProps)(Search); |