forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
37 lines (30 loc) · 1.03 KB
/
index.js
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
37
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {submitInteractiveDialog} from 'mattermost-redux/actions/integrations';
import InteractiveDialog from './interactive_dialog';
function mapStateToProps(state) {
const data = state.entities.integrations.dialog;
if (!data || !data.dialog) {
return {};
}
return {
url: data.url,
callbackId: data.dialog.callback_id,
elements: data.dialog.elements,
title: data.dialog.title,
iconUrl: data.dialog.icon_url,
submitLabel: data.dialog.submit_label,
notifyOnCancel: data.dialog.notify_on_cancel,
state: data.dialog.state,
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
submitInteractiveDialog,
}, dispatch),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(InteractiveDialog);