bigbuffet-rw/app/soapbox/features/compose/containers/upload_button_container.js

21 lines
568 B
JavaScript
Raw Normal View History

2022-03-30 07:36:01 -07:00
import { injectIntl } from 'react-intl';
2020-03-27 13:59:38 -07:00
import { connect } from 'react-redux';
2020-03-27 13:59:38 -07:00
import { uploadCompose } from '../../../actions/compose';
import UploadButton from '../components/upload_button';
2020-03-27 13:59:38 -07:00
const mapStateToProps = state => ({
disabled: state.getIn(['compose', 'is_uploading']),
2020-03-27 13:59:38 -07:00
resetFileKey: state.getIn(['compose', 'resetFileKey']),
});
2022-03-30 07:36:01 -07:00
const mapDispatchToProps = (dispatch, { intl }) => ({
2020-03-27 13:59:38 -07:00
onSelectFile(files) {
2022-03-30 07:36:01 -07:00
dispatch(uploadCompose(files, intl));
2020-03-27 13:59:38 -07:00
},
});
2022-03-30 07:36:01 -07:00
export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(UploadButton));