* Update screens * Update login tests * Remove done * Fix failing tests * Update screens and components * Check styles fix * Update tests * Prevent setState call after component unmounts * Add empty setButtons func to dummy navigator * Remove platform check * Remove Platform import * Update react-native-navigation version * Add separate showModalOverCurrentContext function * check-style fixes * Remove overriding of AppDelegate's window * Fix modal over current context animation * Add showSearchModal navigation action * Check-style fix * Address review comments * Update SettingsSidebar and children * Update EditProfile screen * Update SettingsSidebar * Keep track of latest componentId to appear * Track componentId in state to use in navigation actions * Update FlaggedPosts and children * Update RecentMentions * Update Settings * Store componentIds in ephemeral store * Update AttachmentButton * Remove unnecessary dismissModal * Fix typo * Check-style fix * Address review comments
38 lines
1.3 KiB
JavaScript
38 lines
1.3 KiB
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {bindActionCreators} from 'redux';
|
|
import {connect} from 'react-redux';
|
|
|
|
import {canDownloadFilesOnMobile} from 'mattermost-redux/selectors/entities/general';
|
|
import {makeGetFilesForPost} from 'mattermost-redux/selectors/entities/files';
|
|
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
|
|
|
|
import {showModalOverCurrentContext} from 'app/actions/navigation';
|
|
import {loadFilesForPostIfNecessary} from 'app/actions/views/channel';
|
|
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),
|
|
canDownloadFiles: canDownloadFilesOnMobile(state),
|
|
files: getFilesForPost(state, ownProps.postId),
|
|
theme: getTheme(state),
|
|
};
|
|
};
|
|
}
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
return {
|
|
actions: bindActionCreators({
|
|
loadFilesForPostIfNecessary,
|
|
showModalOverCurrentContext,
|
|
}, dispatch),
|
|
};
|
|
}
|
|
|
|
export default connect(makeMapStateToProps, mapDispatchToProps)(FileAttachmentList);
|