]>
cat aescling's git repositories - mastodon.git/blob - app/javascript/mastodon/features/compose/containers/compose_form_container.js
1 import { connect
} from 'react-redux';
2 import ComposeForm
from '../components/compose_form';
3 import { uploadCompose
} from '../../../actions/compose';
7 clearComposeSuggestions
,
8 fetchComposeSuggestions
,
9 selectComposeSuggestion
,
10 changeComposeSpoilerText
,
12 } from '../../../actions/compose';
14 const mapStateToProps
= state
=> ({
15 text: state
.getIn(['compose', 'text']),
16 suggestion_token: state
.getIn(['compose', 'suggestion_token']),
17 suggestions: state
.getIn(['compose', 'suggestions']),
18 spoiler: state
.getIn(['compose', 'spoiler']),
19 spoiler_text: state
.getIn(['compose', 'spoiler_text']),
20 privacy: state
.getIn(['compose', 'privacy']),
21 focusDate: state
.getIn(['compose', 'focusDate']),
22 preselectDate: state
.getIn(['compose', 'preselectDate']),
23 is_submitting: state
.getIn(['compose', 'is_submitting']),
24 is_uploading: state
.getIn(['compose', 'is_uploading']),
25 showSearch: state
.getIn(['search', 'submitted']) && !state
.getIn(['search', 'hidden']),
28 const mapDispatchToProps
= (dispatch
) => ({
31 dispatch(changeCompose(text
));
35 dispatch(submitCompose());
38 onClearSuggestions () {
39 dispatch(clearComposeSuggestions());
42 onFetchSuggestions (token
) {
43 dispatch(fetchComposeSuggestions(token
));
46 onSuggestionSelected (position
, token
, accountId
) {
47 dispatch(selectComposeSuggestion(position
, token
, accountId
));
50 onChangeSpoilerText (checked
) {
51 dispatch(changeComposeSpoilerText(checked
));
55 dispatch(uploadCompose(files
));
58 onPickEmoji (position
, data
) {
59 dispatch(insertEmojiCompose(position
, data
));
64 export default connect(mapStateToProps
, mapDispatchToProps
)(ComposeForm
);
This page took 0.079855 seconds and 4 git commands to generate.