* Add react-navigator dependency * Add react-native-navigation dependency * react-native-navigation, ios and android config * update react-native-navigation * New navigation and code cleanup * Set ScreenBackgroundColor * Fix channel drawer event issue * Applied RNPN non-working popInitial notification * Android navbar and back button * packages and notices * MM-redux update * Fix draft on team switch * Remove custom NavBar
33 lines
1,014 B
JavaScript
33 lines
1,014 B
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 {addFileToFetchCache} from 'app/actions/views/file_preview';
|
|
import {getTheme} from 'app/selectors/preferences';
|
|
import {makeGetFilesForPost} from 'mattermost-redux/selectors/entities/files';
|
|
|
|
import ImagePreview from './image_preview';
|
|
|
|
function makeMapStateToProps() {
|
|
const getFilesForPost = makeGetFilesForPost();
|
|
return function mapStateToProps(state, ownProps) {
|
|
return {
|
|
...ownProps,
|
|
fetchCache: state.views.fetchCache,
|
|
files: getFilesForPost(state, ownProps.post),
|
|
theme: getTheme(state)
|
|
};
|
|
};
|
|
}
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
return {
|
|
actions: bindActionCreators({
|
|
addFileToFetchCache
|
|
}, dispatch)
|
|
};
|
|
}
|
|
|
|
export default connect(makeMapStateToProps, mapDispatchToProps)(ImagePreview);
|