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.

25 lines
768 B

  1. import { connect } from 'react-redux';
  2. import UploadForm from '../components/upload_form';
  3. import { uploadCompose, undoUploadCompose } from '../actions/compose';
  4. const mapStateToProps = function (state, props) {
  5. return {
  6. media: state.getIn(['compose', 'media_attachments']),
  7. progress: state.getIn(['compose', 'progress']),
  8. is_uploading: state.getIn(['compose', 'is_uploading'])
  9. };
  10. };
  11. const mapDispatchToProps = function (dispatch) {
  12. return {
  13. onSelectFile: function (files) {
  14. dispatch(uploadCompose(files));
  15. },
  16. onRemoveFile: function (media_id) {
  17. dispatch(undoUploadCompose(media_id));
  18. }
  19. }
  20. };
  21. export default connect(mapStateToProps, mapDispatchToProps)(UploadForm);