Files
mattermost-mobile/app/screens/long_post/index.js
Mattermost Build 5a16752275 Automated cherry pick of #3623 (#3626)
* MM-20689 Long post to use all available space

* Add footer and update snapshots

* Fix footer ui

* Remove file_ids from connected component
2019-11-28 17:41:23 +08:00

42 lines
1.4 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 {selectPost} from 'mattermost-redux/actions/posts';
import {makeGetChannel} from 'mattermost-redux/selectors/entities/channels';
import {getPost} from 'mattermost-redux/selectors/entities/posts';
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
import {loadThreadIfNecessary} from 'app/actions/views/channel';
import {isLandscape} from 'app/selectors/device';
import LongPost from './long_post';
function makeMapStateToProps() {
const getChannel = makeGetChannel();
return function mapStateToProps(state, ownProps) {
const post = getPost(state, ownProps.postId);
const channel = post ? getChannel(state, {id: post.channel_id}) : null;
return {
channelName: channel ? channel.display_name : '',
inThreadView: Boolean(state.entities.posts.selectedPostId),
theme: getTheme(state),
isLandscape: isLandscape(state),
};
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
loadThreadIfNecessary,
selectPost,
}, dispatch),
};
}
export default connect(makeMapStateToProps, mapDispatchToProps)(LongPost);