|
@@ -5,7 +5,6 @@ import React from 'react';
|
5
|
5
|
import {
|
6
|
6
|
ActivityIndicator,
|
7
|
7
|
FlatList,
|
8
|
|
- KeyboardAvoidingView,
|
9
|
8
|
Platform,
|
10
|
9
|
SafeAreaView,
|
11
|
10
|
TextInput,
|
|
@@ -25,16 +24,15 @@ import {
|
25
|
24
|
IconSearch,
|
26
|
25
|
IconShare
|
27
|
26
|
} from '../../../../base/icons';
|
|
27
|
+import { JitsiModal, setActiveModalId } from '../../../../base/modal';
|
28
|
28
|
import {
|
29
|
29
|
AvatarListItem,
|
30
|
|
- HeaderWithNavigation,
|
31
|
|
- SlidingView,
|
32
|
30
|
type Item
|
33
|
31
|
} from '../../../../base/react';
|
34
|
32
|
import { connect } from '../../../../base/redux';
|
35
|
33
|
import { beginShareRoom } from '../../../../share-room';
|
36
|
34
|
|
37
|
|
-import { setAddPeopleDialogVisible } from '../../../actions.native';
|
|
35
|
+import { ADD_PEOPLE_DIALOG_VIEW_ID } from '../../../constants';
|
38
|
36
|
|
39
|
37
|
import AbstractAddPeopleDialog, {
|
40
|
38
|
type Props as AbstractProps,
|
|
@@ -131,11 +129,11 @@ class AddPeopleDialog extends AbstractAddPeopleDialog<Props, State> {
|
131
|
129
|
this._renderItem = this._renderItem.bind(this);
|
132
|
130
|
this._renderSeparator = this._renderSeparator.bind(this);
|
133
|
131
|
this._onClearField = this._onClearField.bind(this);
|
134
|
|
- this._onCloseAddPeopleDialog = this._onCloseAddPeopleDialog.bind(this);
|
135
|
132
|
this._onInvite = this._onInvite.bind(this);
|
136
|
133
|
this._onPressItem = this._onPressItem.bind(this);
|
137
|
134
|
this._onShareMeeting = this._onShareMeeting.bind(this);
|
138
|
135
|
this._onTypeQuery = this._onTypeQuery.bind(this);
|
|
136
|
+ this._renderShareMeetingButton = this._renderShareMeetingButton.bind(this);
|
139
|
137
|
this._setFieldRef = this._setFieldRef.bind(this);
|
140
|
138
|
}
|
141
|
139
|
|
|
@@ -159,8 +157,7 @@ class AddPeopleDialog extends AbstractAddPeopleDialog<Props, State> {
|
159
|
157
|
render() {
|
160
|
158
|
const {
|
161
|
159
|
_addPeopleEnabled,
|
162
|
|
- _dialOutEnabled,
|
163
|
|
- _headerStyles
|
|
160
|
+ _dialOutEnabled
|
164
|
161
|
} = this.props;
|
165
|
162
|
const { inviteItems, selectableItems } = this.state;
|
166
|
163
|
|
|
@@ -173,72 +170,58 @@ class AddPeopleDialog extends AbstractAddPeopleDialog<Props, State> {
|
173
|
170
|
}
|
174
|
171
|
|
175
|
172
|
return (
|
176
|
|
- <SlidingView
|
177
|
|
- onHide = { this._onCloseAddPeopleDialog }
|
178
|
|
- position = 'bottom'
|
179
|
|
- show = { this.props._isVisible } >
|
180
|
|
- <HeaderWithNavigation
|
181
|
|
- forwardDisabled = { this._isAddDisabled() }
|
182
|
|
- forwardLabelKey = 'inviteDialog.send'
|
183
|
|
- headerLabelKey = 'inviteDialog.header'
|
184
|
|
- onPressBack = { this._onCloseAddPeopleDialog }
|
185
|
|
- onPressForward = { this._onInvite } />
|
186
|
|
- <KeyboardAvoidingView
|
187
|
|
- behavior = 'padding'
|
188
|
|
- style = { styles.avoidingView }>
|
189
|
|
- <SafeAreaView style = { styles.dialogWrapper }>
|
190
|
|
- <View
|
191
|
|
- style = { styles.searchFieldWrapper }>
|
192
|
|
- <View style = { styles.searchIconWrapper }>
|
193
|
|
- { this.state.searchInprogress
|
194
|
|
- ? <ActivityIndicator
|
195
|
|
- color = { DARK_GREY }
|
196
|
|
- size = 'small' />
|
197
|
|
- : <Icon
|
198
|
|
- src = { IconSearch }
|
199
|
|
- style = { styles.searchIcon } />}
|
200
|
|
- </View>
|
201
|
|
- <TextInput
|
202
|
|
- autoCorrect = { false }
|
203
|
|
- autoFocus = { false }
|
204
|
|
- onBlur = { this._onFocused(false) }
|
205
|
|
- onChangeText = { this._onTypeQuery }
|
206
|
|
- onFocus = { this._onFocused(true) }
|
207
|
|
- placeholder = {
|
208
|
|
- this.props.t(`inviteDialog.${placeholderKey}`)
|
209
|
|
- }
|
210
|
|
- ref = { this._setFieldRef }
|
211
|
|
- style = { styles.searchField }
|
212
|
|
- value = { this.state.fieldValue } />
|
213
|
|
- { this._renderClearButton() }
|
214
|
|
- </View>
|
215
|
|
- { Boolean(inviteItems.length) && <View style = { styles.invitedList }>
|
216
|
|
- <FlatList
|
217
|
|
- data = { inviteItems }
|
218
|
|
- horizontal = { true }
|
219
|
|
- keyExtractor = { this._keyExtractor }
|
220
|
|
- keyboardShouldPersistTaps = 'always'
|
221
|
|
- renderItem = { this._renderInvitedItem } />
|
222
|
|
- </View> }
|
223
|
|
- <View style = { styles.resultList }>
|
224
|
|
- <FlatList
|
225
|
|
- ItemSeparatorComponent = { this._renderSeparator }
|
226
|
|
- data = { selectableItems }
|
227
|
|
- extraData = { inviteItems }
|
228
|
|
- keyExtractor = { this._keyExtractor }
|
229
|
|
- keyboardShouldPersistTaps = 'always'
|
230
|
|
- renderItem = { this._renderItem } />
|
231
|
|
- </View>
|
232
|
|
- </SafeAreaView>
|
233
|
|
- <SafeAreaView
|
234
|
|
- style = { [
|
235
|
|
- styles.bottomBar,
|
236
|
|
- _headerStyles.headerOverlay,
|
237
|
|
- this.state.bottomPadding ? styles.extraBarPadding : null ] }>
|
238
|
|
- { this._renderShareMeetingButton() }
|
239
|
|
- </SafeAreaView>
|
240
|
|
- </KeyboardAvoidingView>
|
241
|
|
- </SlidingView>
|
|
173
|
+ <JitsiModal
|
|
174
|
+ footerComponent = { this._renderShareMeetingButton }
|
|
175
|
+ headerProps = {{
|
|
176
|
+ forwardDisabled: this._isAddDisabled(),
|
|
177
|
+ forwardLabelKey: 'inviteDialog.send',
|
|
178
|
+ headerLabelKey: 'inviteDialog.header',
|
|
179
|
+ onPressForward: this._onInvite
|
|
180
|
+ }}
|
|
181
|
+ modalId = { ADD_PEOPLE_DIALOG_VIEW_ID }>
|
|
182
|
+ <View
|
|
183
|
+ style = { styles.searchFieldWrapper }>
|
|
184
|
+ <View style = { styles.searchIconWrapper }>
|
|
185
|
+ { this.state.searchInprogress
|
|
186
|
+ ? <ActivityIndicator
|
|
187
|
+ color = { DARK_GREY }
|
|
188
|
+ size = 'small' />
|
|
189
|
+ : <Icon
|
|
190
|
+ src = { IconSearch }
|
|
191
|
+ style = { styles.searchIcon } />}
|
|
192
|
+ </View>
|
|
193
|
+ <TextInput
|
|
194
|
+ autoCorrect = { false }
|
|
195
|
+ autoFocus = { false }
|
|
196
|
+ onBlur = { this._onFocused(false) }
|
|
197
|
+ onChangeText = { this._onTypeQuery }
|
|
198
|
+ onFocus = { this._onFocused(true) }
|
|
199
|
+ placeholder = {
|
|
200
|
+ this.props.t(`inviteDialog.${placeholderKey}`)
|
|
201
|
+ }
|
|
202
|
+ ref = { this._setFieldRef }
|
|
203
|
+ style = { styles.searchField }
|
|
204
|
+ value = { this.state.fieldValue } />
|
|
205
|
+ { this._renderClearButton() }
|
|
206
|
+ </View>
|
|
207
|
+ { Boolean(inviteItems.length) && <View style = { styles.invitedList }>
|
|
208
|
+ <FlatList
|
|
209
|
+ data = { inviteItems }
|
|
210
|
+ horizontal = { true }
|
|
211
|
+ keyExtractor = { this._keyExtractor }
|
|
212
|
+ keyboardShouldPersistTaps = 'always'
|
|
213
|
+ renderItem = { this._renderInvitedItem } />
|
|
214
|
+ </View> }
|
|
215
|
+ <View style = { styles.resultList }>
|
|
216
|
+ <FlatList
|
|
217
|
+ ItemSeparatorComponent = { this._renderSeparator }
|
|
218
|
+ data = { selectableItems }
|
|
219
|
+ extraData = { inviteItems }
|
|
220
|
+ keyExtractor = { this._keyExtractor }
|
|
221
|
+ keyboardShouldPersistTaps = 'always'
|
|
222
|
+ renderItem = { this._renderItem } />
|
|
223
|
+ </View>
|
|
224
|
+ </JitsiModal>
|
242
|
225
|
);
|
243
|
226
|
}
|
244
|
227
|
|
|
@@ -311,23 +294,6 @@ class AddPeopleDialog extends AbstractAddPeopleDialog<Props, State> {
|
311
|
294
|
this._onTypeQuery('');
|
312
|
295
|
}
|
313
|
296
|
|
314
|
|
- _onCloseAddPeopleDialog: () => boolean
|
315
|
|
-
|
316
|
|
- /**
|
317
|
|
- * Closes the dialog.
|
318
|
|
- *
|
319
|
|
- * @returns {boolean}
|
320
|
|
- */
|
321
|
|
- _onCloseAddPeopleDialog() {
|
322
|
|
- if (this.props._isVisible) {
|
323
|
|
- this.props.dispatch(setAddPeopleDialogVisible(false));
|
324
|
|
-
|
325
|
|
- return true;
|
326
|
|
- }
|
327
|
|
-
|
328
|
|
- return false;
|
329
|
|
- }
|
330
|
|
-
|
331
|
297
|
_onFocused: boolean => Function;
|
332
|
298
|
|
333
|
299
|
/**
|
|
@@ -360,7 +326,7 @@ class AddPeopleDialog extends AbstractAddPeopleDialog<Props, State> {
|
360
|
326
|
});
|
361
|
327
|
this._showFailedInviteAlert();
|
362
|
328
|
} else {
|
363
|
|
- this._onCloseAddPeopleDialog();
|
|
329
|
+ this.props.dispatch(setActiveModalId());
|
364
|
330
|
}
|
365
|
331
|
});
|
366
|
332
|
}
|
|
@@ -587,6 +553,8 @@ class AddPeopleDialog extends AbstractAddPeopleDialog<Props, State> {
|
587
|
553
|
);
|
588
|
554
|
}
|
589
|
555
|
|
|
556
|
+ _renderShareMeetingButton: () => React$Element<any>;
|
|
557
|
+
|
590
|
558
|
/**
|
591
|
559
|
* Renders a button to share the meeting info.
|
592
|
560
|
*
|
|
@@ -596,12 +564,19 @@ class AddPeopleDialog extends AbstractAddPeopleDialog<Props, State> {
|
596
|
564
|
const { _headerStyles } = this.props;
|
597
|
565
|
|
598
|
566
|
return (
|
599
|
|
- <TouchableOpacity
|
600
|
|
- onPress = { this._onShareMeeting }>
|
601
|
|
- <Icon
|
602
|
|
- src = { IconShare }
|
603
|
|
- style = { [ _headerStyles.headerButtonText, styles.shareIcon ] } />
|
604
|
|
- </TouchableOpacity>
|
|
567
|
+ <SafeAreaView
|
|
568
|
+ style = { [
|
|
569
|
+ styles.bottomBar,
|
|
570
|
+ _headerStyles.headerOverlay,
|
|
571
|
+ this.state.bottomPadding ? styles.extraBarPadding : null
|
|
572
|
+ ] }>
|
|
573
|
+ <TouchableOpacity
|
|
574
|
+ onPress = { this._onShareMeeting }>
|
|
575
|
+ <Icon
|
|
576
|
+ src = { IconShare }
|
|
577
|
+ style = { [ _headerStyles.headerButtonText, styles.shareIcon ] } />
|
|
578
|
+ </TouchableOpacity>
|
|
579
|
+ </SafeAreaView>
|
605
|
580
|
);
|
606
|
581
|
}
|
607
|
582
|
|
|
@@ -647,7 +622,7 @@ function _mapStateToProps(state: Object) {
|
647
|
622
|
return {
|
648
|
623
|
..._abstractMapStateToProps(state),
|
649
|
624
|
_headerStyles: ColorSchemeRegistry.get(state, 'Header'),
|
650
|
|
- _isVisible: state['features/invite'].inviteDialogVisible
|
|
625
|
+ _isVisible: state['features/base/modal'].activeModalId === ADD_PEOPLE_DIALOG_VIEW_ID
|
651
|
626
|
};
|
652
|
627
|
}
|
653
|
628
|
|