summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view/post_attachment_opengraph/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/post_view/post_attachment_opengraph/index.js')
-rw-r--r--webapp/components/post_view/post_attachment_opengraph/index.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/webapp/components/post_view/post_attachment_opengraph/index.js b/webapp/components/post_view/post_attachment_opengraph/index.js
new file mode 100644
index 000000000..e0bec8f36
--- /dev/null
+++ b/webapp/components/post_view/post_attachment_opengraph/index.js
@@ -0,0 +1,26 @@
+// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+import {connect} from 'react-redux';
+import {bindActionCreators} from 'redux';
+import {getOpenGraphMetadata} from 'mattermost-redux/actions/posts';
+import {getOpenGraphMetadataForUrl} from 'mattermost-redux/selectors/entities/posts';
+
+import PostAttachmentOpenGraph from './post_attachment_opengraph.jsx';
+
+function mapStateToProps(state, ownProps) {
+ return {
+ ...ownProps,
+ openGraphData: getOpenGraphMetadataForUrl(state, ownProps.link)
+ };
+}
+
+function mapDispatchToProps(dispatch) {
+ return {
+ actions: bindActionCreators({
+ getOpenGraphMetadata
+ }, dispatch)
+ };
+}
+
+export default connect(mapStateToProps, mapDispatchToProps)(PostAttachmentOpenGraph);