forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
36 lines (29 loc) · 1.19 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {GenericAction} from 'mattermost-redux/types/actions';
import {connect} from 'react-redux';
import {bindActionCreators, Dispatch} from 'redux';
import {toggleEmbedVisibility} from 'actions/post_actions';
import {isEmbedVisible} from 'selectors/posts';
import {GlobalState} from 'types/store';
import {PostWillRenderEmbedPluginComponent} from 'types/store/plugins';
import {appsEnabled} from 'utils/utils';
import PostBodyAdditionalContent, {
Props,
} from './post_body_additional_content';
function mapStateToProps(state: GlobalState, ownProps: Props) {
return {
isEmbedVisible: isEmbedVisible(state, ownProps.post.id),
pluginPostWillRenderEmbedComponents: state.plugins.components.PostWillRenderEmbedComponent as unknown as PostWillRenderEmbedPluginComponent[],
appsEnabled: appsEnabled(state),
};
}
function mapDispatchToProps(dispatch: Dispatch<GenericAction>) {
return {
actions: bindActionCreators({toggleEmbedVisibility}, dispatch),
};
}
export default connect(
mapStateToProps,
mapDispatchToProps,
)(PostBodyAdditionalContent);