You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
768 B
26 lines
768 B
8 years ago
|
import { connect } from 'react-redux';
|
||
|
import UploadForm from '../components/upload_form';
|
||
|
import { uploadCompose, undoUploadCompose } from '../actions/compose';
|
||
|
|
||
|
const mapStateToProps = function (state, props) {
|
||
|
return {
|
||
|
media: state.getIn(['compose', 'media_attachments']),
|
||
|
progress: state.getIn(['compose', 'progress']),
|
||
|
is_uploading: state.getIn(['compose', 'is_uploading'])
|
||
|
};
|
||
|
};
|
||
|
|
||
|
const mapDispatchToProps = function (dispatch) {
|
||
|
return {
|
||
|
onSelectFile: function (files) {
|
||
|
dispatch(uploadCompose(files));
|
||
|
},
|
||
|
|
||
|
onRemoveFile: function (media_id) {
|
||
|
dispatch(undoUploadCompose(media_id));
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
export default connect(mapStateToProps, mapDispatchToProps)(UploadForm);
|