logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

upload_button_container.js (643B)


  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. resetFileKey: state.getIn(['compose', 'resetFileKey']),
  7. });
  8. const mapDispatchToProps = dispatch => ({
  9. onSelectFile (files) {
  10. dispatch(uploadCompose(files));
  11. },
  12. });
  13. export default connect(mapStateToProps, mapDispatchToProps)(UploadButton);