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.

31 lines
852 B

  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. import { submitCompose } from '../../../actions/compose';
  6. const mapStateToProps = (state, { id }) => ({
  7. media: state.getIn(['compose', 'media_attachments']).find(item => item.get('id') === id),
  8. });
  9. const mapDispatchToProps = dispatch => ({
  10. onUndo: id => {
  11. dispatch(undoUploadCompose(id));
  12. },
  13. onDescriptionChange: (id, description) => {
  14. dispatch(changeUploadCompose(id, { description }));
  15. },
  16. onOpenFocalPoint: id => {
  17. dispatch(openModal('FOCAL_POINT', { id }));
  18. },
  19. onSubmit (router) {
  20. dispatch(submitCompose(router));
  21. },
  22. });
  23. export default connect(mapStateToProps, mapDispatchToProps)(Upload);