ComposerUploadForm → UploadForm + UploadFormContainer
This commit is contained in:
@ -7,14 +7,12 @@ import {
|
||||
changeComposeSpoilerText,
|
||||
changeComposeSpoilerness,
|
||||
changeComposeVisibility,
|
||||
changeUploadCompose,
|
||||
clearComposeSuggestions,
|
||||
fetchComposeSuggestions,
|
||||
insertEmojiCompose,
|
||||
mountCompose,
|
||||
selectComposeSuggestion,
|
||||
submitCompose,
|
||||
undoUploadCompose,
|
||||
unmountCompose,
|
||||
uploadCompose,
|
||||
} from 'flavours/glitch/actions/compose';
|
||||
@ -66,7 +64,6 @@ function mapStateToProps (state) {
|
||||
media: state.getIn(['compose', 'media_attachments']),
|
||||
preselectDate: state.getIn(['compose', 'preselectDate']),
|
||||
privacy: state.getIn(['compose', 'privacy']),
|
||||
progress: state.getIn(['compose', 'progress']),
|
||||
resetFileKey: state.getIn(['compose', 'resetFileKey']),
|
||||
sideArm: sideArmPrivacy,
|
||||
sensitive: state.getIn(['compose', 'sensitive']),
|
||||
@ -89,9 +86,6 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
||||
onChangeAdvancedOption(option, value) {
|
||||
dispatch(changeComposeAdvancedOption(option, value));
|
||||
},
|
||||
onChangeDescription(id, description) {
|
||||
dispatch(changeUploadCompose(id, { description }));
|
||||
},
|
||||
onChangeSensitivity() {
|
||||
dispatch(changeComposeSensitivity());
|
||||
},
|
||||
@ -137,9 +131,6 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
||||
onOpenDoodleModal() {
|
||||
dispatch(openModal('DOODLE', { noEsc: true }));
|
||||
},
|
||||
onOpenFocalPointModal(id) {
|
||||
dispatch(openModal('FOCAL_POINT', { id }));
|
||||
},
|
||||
onSelectSuggestion(position, token, suggestion) {
|
||||
dispatch(selectComposeSuggestion(position, token, suggestion));
|
||||
},
|
||||
@ -154,9 +145,6 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
||||
onSubmit(routerHistory) {
|
||||
dispatch(submitCompose(routerHistory));
|
||||
},
|
||||
onUndoUpload(id) {
|
||||
dispatch(undoUploadCompose(id));
|
||||
},
|
||||
onUnmount() {
|
||||
dispatch(unmountCompose());
|
||||
},
|
||||
|
@ -0,0 +1,31 @@
|
||||
import { connect } from 'react-redux';
|
||||
import Upload from '../components/upload';
|
||||
import { undoUploadCompose, changeUploadCompose } from 'flavours/glitch/actions/compose';
|
||||
import { openModal } from 'flavours/glitch/actions/modal';
|
||||
import { submitCompose } from 'flavours/glitch/actions/compose';
|
||||
|
||||
const mapStateToProps = (state, { id }) => ({
|
||||
media: state.getIn(['compose', 'media_attachments']).find(item => item.get('id') === id),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
|
||||
onUndo: id => {
|
||||
dispatch(undoUploadCompose(id));
|
||||
},
|
||||
|
||||
onDescriptionChange: (id, description) => {
|
||||
dispatch(changeUploadCompose(id, { description }));
|
||||
},
|
||||
|
||||
onOpenFocalPoint: id => {
|
||||
dispatch(openModal('FOCAL_POINT', { id }));
|
||||
},
|
||||
|
||||
onSubmit (router) {
|
||||
dispatch(submitCompose(router));
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(Upload);
|
@ -0,0 +1,8 @@
|
||||
import { connect } from 'react-redux';
|
||||
import UploadForm from '../components/upload_form';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
mediaIds: state.getIn(['compose', 'media_attachments']).map(item => item.get('id')),
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps)(UploadForm);
|
@ -0,0 +1,9 @@
|
||||
import { connect } from 'react-redux';
|
||||
import UploadProgress from '../components/upload_progress';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
active: state.getIn(['compose', 'is_uploading']),
|
||||
progress: state.getIn(['compose', 'progress']),
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps)(UploadProgress);
|
Reference in New Issue
Block a user