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.

17 lines
584 B

  1. import { connect } from 'react-redux';
  2. import UploadButton from '../components/upload_button';
  3. import { uploadCompose } from '../../../actions/compose';
  4. const mapStateToProps = state => ({
  5. disabled: state.getIn(['compose', 'is_uploading']) || (state.getIn(['compose', 'media_attachments']).size > 3 || state.getIn(['compose', 'media_attachments']).some(m => m.get('type') === 'video')),
  6. });
  7. const mapDispatchToProps = dispatch => ({
  8. onSelectFile (files) {
  9. dispatch(uploadCompose(files));
  10. }
  11. });
  12. export default connect(mapStateToProps, mapDispatchToProps)(UploadButton);