|
@@ -13,9 +13,18 @@ import {
|
13
|
13
|
View
|
14
|
14
|
} from 'react-native';
|
15
|
15
|
|
|
16
|
+import { ColorSchemeRegistry } from '../../../../base/color-scheme';
|
16
|
17
|
import { AlertDialog, openDialog } from '../../../../base/dialog';
|
17
|
18
|
import { translate } from '../../../../base/i18n';
|
18
|
|
-import { Icon, IconCancelSelection, IconCheck, IconClose, IconPhone, IconSearch } from '../../../../base/icons';
|
|
19
|
+import {
|
|
20
|
+ Icon,
|
|
21
|
+ IconCancelSelection,
|
|
22
|
+ IconCheck,
|
|
23
|
+ IconClose,
|
|
24
|
+ IconPhone,
|
|
25
|
+ IconSearch,
|
|
26
|
+ IconShare
|
|
27
|
+} from '../../../../base/icons';
|
19
|
28
|
import {
|
20
|
29
|
AvatarListItem,
|
21
|
30
|
HeaderWithNavigation,
|
|
@@ -23,6 +32,7 @@ import {
|
23
|
32
|
type Item
|
24
|
33
|
} from '../../../../base/react';
|
25
|
34
|
import { connect } from '../../../../base/redux';
|
|
35
|
+import { beginShareRoom } from '../../../../share-room';
|
26
|
36
|
|
27
|
37
|
import { setAddPeopleDialogVisible } from '../../../actions.native';
|
28
|
38
|
|
|
@@ -39,6 +49,11 @@ import styles, {
|
39
|
49
|
|
40
|
50
|
type Props = AbstractProps & {
|
41
|
51
|
|
|
52
|
+ /**
|
|
53
|
+ * The color schemed style of the Header.
|
|
54
|
+ */
|
|
55
|
+ _headerStyles: Object,
|
|
56
|
+
|
42
|
57
|
/**
|
43
|
58
|
* True if the invite dialog should be open, false otherwise.
|
44
|
59
|
*/
|
|
@@ -113,6 +128,7 @@ class AddPeopleDialog extends AbstractAddPeopleDialog<Props, State> {
|
113
|
128
|
this._onCloseAddPeopleDialog = this._onCloseAddPeopleDialog.bind(this);
|
114
|
129
|
this._onInvite = this._onInvite.bind(this);
|
115
|
130
|
this._onPressItem = this._onPressItem.bind(this);
|
|
131
|
+ this._onShareMeeting = this._onShareMeeting.bind(this);
|
116
|
132
|
this._onTypeQuery = this._onTypeQuery.bind(this);
|
117
|
133
|
this._setFieldRef = this._setFieldRef.bind(this);
|
118
|
134
|
}
|
|
@@ -137,7 +153,8 @@ class AddPeopleDialog extends AbstractAddPeopleDialog<Props, State> {
|
137
|
153
|
render() {
|
138
|
154
|
const {
|
139
|
155
|
_addPeopleEnabled,
|
140
|
|
- _dialOutEnabled
|
|
156
|
+ _dialOutEnabled,
|
|
157
|
+ _headerStyles
|
141
|
158
|
} = this.props;
|
142
|
159
|
const { inviteItems, selectableItems } = this.state;
|
143
|
160
|
|
|
@@ -206,6 +223,9 @@ class AddPeopleDialog extends AbstractAddPeopleDialog<Props, State> {
|
206
|
223
|
renderItem = { this._renderItem } />
|
207
|
224
|
</View>
|
208
|
225
|
</SafeAreaView>
|
|
226
|
+ <SafeAreaView style = { [ styles.bottomBar, _headerStyles.headerOverlay ] }>
|
|
227
|
+ { this._renderShareMeetingButton() }
|
|
228
|
+ </SafeAreaView>
|
209
|
229
|
</KeyboardAvoidingView>
|
210
|
230
|
</SlidingView>
|
211
|
231
|
);
|
|
@@ -349,6 +369,22 @@ class AddPeopleDialog extends AbstractAddPeopleDialog<Props, State> {
|
349
|
369
|
};
|
350
|
370
|
}
|
351
|
371
|
|
|
372
|
+ _onShareMeeting: () => void
|
|
373
|
+
|
|
374
|
+ /**
|
|
375
|
+ * Shows the system share sheet to share the meeting information.
|
|
376
|
+ *
|
|
377
|
+ * @returns {void}
|
|
378
|
+ */
|
|
379
|
+ _onShareMeeting() {
|
|
380
|
+ if (this.state.inviteItems.length > 0) {
|
|
381
|
+ // The use probably intended to invite people.
|
|
382
|
+ this._onInvite();
|
|
383
|
+ } else {
|
|
384
|
+ this.props.dispatch(beginShareRoom());
|
|
385
|
+ }
|
|
386
|
+ }
|
|
387
|
+
|
352
|
388
|
_onTypeQuery: string => void
|
353
|
389
|
|
354
|
390
|
/**
|
|
@@ -526,6 +562,24 @@ class AddPeopleDialog extends AbstractAddPeopleDialog<Props, State> {
|
526
|
562
|
);
|
527
|
563
|
}
|
528
|
564
|
|
|
565
|
+ /**
|
|
566
|
+ * Renders a button to share the meeting info.
|
|
567
|
+ *
|
|
568
|
+ * @returns {React#Element<*>}
|
|
569
|
+ */
|
|
570
|
+ _renderShareMeetingButton() {
|
|
571
|
+ const { _headerStyles } = this.props;
|
|
572
|
+
|
|
573
|
+ return (
|
|
574
|
+ <TouchableOpacity
|
|
575
|
+ onPress = { this._onShareMeeting }>
|
|
576
|
+ <Icon
|
|
577
|
+ src = { IconShare }
|
|
578
|
+ style = { [ _headerStyles.headerButtonText, styles.shareIcon ] } />
|
|
579
|
+ </TouchableOpacity>
|
|
580
|
+ );
|
|
581
|
+ }
|
|
582
|
+
|
529
|
583
|
_setFieldRef: ?TextInput => void
|
530
|
584
|
|
531
|
585
|
/**
|
|
@@ -567,6 +621,7 @@ class AddPeopleDialog extends AbstractAddPeopleDialog<Props, State> {
|
567
|
621
|
function _mapStateToProps(state: Object) {
|
568
|
622
|
return {
|
569
|
623
|
..._abstractMapStateToProps(state),
|
|
624
|
+ _headerStyles: ColorSchemeRegistry.get(state, 'Header'),
|
570
|
625
|
_isVisible: state['features/invite'].inviteDialogVisible
|
571
|
626
|
};
|
572
|
627
|
}
|