mattermost-mobile/app/components/file_attachment_list/index.js
Elias Nahum 1f7ec07786
Show attachments in horizontal ScrollView (#1513)
* Show attachments in horizontal ScrollView

* feedback review
2018-03-17 12:31:41 +02:00

38 lines
1.3 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 {makeGetFilesForPost} from 'mattermost-redux/selectors/entities/files';
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
import {loadFilesForPostIfNecessary} from 'app/actions/views/channel';
import {addFileToFetchCache} from 'app/actions/views/file_preview';
import {getDimensions} from 'app/selectors/device';
import FileAttachmentList from './file_attachment_list';
function makeMapStateToProps() {
const getFilesForPost = makeGetFilesForPost();
return function mapStateToProps(state, ownProps) {
return {
...getDimensions(state),
fetchCache: state.views.fetchCache,
files: getFilesForPost(state, ownProps.postId),
theme: getTheme(state),
filesForPostRequest: state.requests.files.getFilesForPost,
};
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
addFileToFetchCache,
loadFilesForPostIfNecessary,
}, dispatch),
};
}
export default connect(makeMapStateToProps, mapDispatchToProps)(FileAttachmentList);