mastodon/app/javascript/flavours/glitch/features/compose/containers/upload_container.js
Claire f3429d7354 [Glitch] Fix controls for unchangeable properties on status edit not being disabled
Port 38845592c4 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2022-02-12 22:36:39 +01:00

28 lines
755 B
JavaScript

import { connect } from 'react-redux';
import Upload from '../components/upload';
import { undoUploadCompose, initMediaEditModal } from 'flavours/glitch/actions/compose';
import { submitCompose } from 'flavours/glitch/actions/compose';
const mapStateToProps = (state, { id }) => ({
media: state.getIn(['compose', 'media_attachments']).find(item => item.get('id') === id),
isEditingStatus: state.getIn(['compose', 'id']) !== null,
});
const mapDispatchToProps = dispatch => ({
onUndo: id => {
dispatch(undoUploadCompose(id));
},
onOpenFocalPoint: id => {
dispatch(initMediaEditModal(id));
},
onSubmit (router) {
dispatch(submitCompose(router));
},
});
export default connect(mapStateToProps, mapDispatchToProps)(Upload);