mattermost-mobile/app/components/file_upload_preview/index.js
Chris Duarte 9d13c985c2 RN-52: RN: Make create post and upload file actions optimistic (#504)
* RN-52: RN: Make create post and upload file actions optimistic

* Review feedback
2017-04-27 08:45:42 -03:00

33 lines
1 KiB
JavaScript

// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {handleRemoveFile} from 'app/actions/views/file_upload';
import {addFileToFetchCache} from 'app/actions/views/file_preview';
import {getTheme} from 'app/selectors/preferences';
import FileUploadPreview from './file_upload_preview';
function mapStateToProps(state, ownProps) {
return {
...ownProps,
channelIsLoading: state.views.channel.loading,
createPostRequestStatus: state.requests.posts.createPost.status,
fetchCache: state.views.fetchCache,
uploadFileRequestStatus: state.requests.files.uploadFiles.status,
theme: getTheme(state)
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
addFileToFetchCache,
handleRemoveFile
}, dispatch)
};
}
export default connect(mapStateToProps, mapDispatchToProps)(FileUploadPreview);