This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
mastodon/app/javascript/flavours/glitch/features/compose/containers/search_container.js

36 lines
658 B
JavaScript
Raw Normal View History

2016-11-13 04:04:18 -08:00
import { connect } from 'react-redux';
import {
changeSearch,
2017-03-31 10:59:54 -07:00
clearSearch,
submitSearch,
showSearch,
2017-12-03 23:26:40 -08:00
} from 'flavours/glitch/actions/search';
2016-11-13 04:04:18 -08:00
import Search from '../components/search';
const mapStateToProps = state => ({
2017-03-31 13:44:12 -07:00
value: state.getIn(['search', 'value']),
submitted: state.getIn(['search', 'submitted']),
2016-11-13 04:04:18 -08:00
});
const mapDispatchToProps = dispatch => ({
onChange (value) {
dispatch(changeSearch(value));
},
onClear () {
2017-03-31 10:59:54 -07:00
dispatch(clearSearch());
2016-11-13 04:04:18 -08:00
},
2017-03-31 10:59:54 -07:00
onSubmit () {
dispatch(submitSearch());
2016-11-13 04:04:18 -08:00
},
2017-03-31 10:59:54 -07:00
onShow () {
dispatch(showSearch());
},
2016-11-13 04:04:18 -08:00
});
export default connect(mapStateToProps, mapDispatchToProps)(Search);