diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-04-21 12:09:52 +0200 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2019-04-22 20:15:47 +0200 |
commit | a243567a3e6100d65477162308e2c1bb5e056c21 (patch) | |
tree | e308927e5453acd62e09f6b6de05c269c362d5b8 /app/javascript/flavours/glitch/features/compose/containers/upload_container.js | |
parent | c5f49a92dce9157debf3a68487dd30b6f0af6c4a (diff) |
ComposerUploadForm → UploadForm + UploadFormContainer
Diffstat (limited to 'app/javascript/flavours/glitch/features/compose/containers/upload_container.js')
-rw-r--r-- | app/javascript/flavours/glitch/features/compose/containers/upload_container.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/features/compose/containers/upload_container.js b/app/javascript/flavours/glitch/features/compose/containers/upload_container.js new file mode 100644 index 000000000..d6bff63ac --- /dev/null +++ b/app/javascript/flavours/glitch/features/compose/containers/upload_container.js @@ -0,0 +1,31 @@ +import { connect } from 'react-redux'; +import Upload from '../components/upload'; +import { undoUploadCompose, changeUploadCompose } from 'flavours/glitch/actions/compose'; +import { openModal } from 'flavours/glitch/actions/modal'; +import { submitCompose } from 'flavours/glitch/actions/compose'; + +const mapStateToProps = (state, { id }) => ({ + media: state.getIn(['compose', 'media_attachments']).find(item => item.get('id') === id), +}); + +const mapDispatchToProps = dispatch => ({ + + onUndo: id => { + dispatch(undoUploadCompose(id)); + }, + + onDescriptionChange: (id, description) => { + dispatch(changeUploadCompose(id, { description })); + }, + + onOpenFocalPoint: id => { + dispatch(openModal('FOCAL_POINT', { id })); + }, + + onSubmit (router) { + dispatch(submitCompose(router)); + }, + +}); + +export default connect(mapStateToProps, mapDispatchToProps)(Upload); |