logo

mastofe

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

upload_container.js (729B)


  1. import { connect } from 'react-redux';
  2. import Upload from '../components/upload';
  3. import { undoUploadCompose, changeUploadCompose } from '../../../actions/compose';
  4. import { openModal } from '../../../actions/modal';
  5. const mapStateToProps = (state, { id }) => ({
  6. media: state.getIn(['compose', 'media_attachments']).find(item => item.get('id') === id),
  7. });
  8. const mapDispatchToProps = dispatch => ({
  9. onUndo: id => {
  10. dispatch(undoUploadCompose(id));
  11. },
  12. onDescriptionChange: (id, description) => {
  13. dispatch(changeUploadCompose(id, { description }));
  14. },
  15. onOpenFocalPoint: id => {
  16. dispatch(openModal('FOCAL_POINT', { id }));
  17. },
  18. });
  19. export default connect(mapStateToProps, mapDispatchToProps)(Upload);