|
|
@@ -7,7 +7,6 @@ import { Divider, Text } from 'react-native-paper';
|
|
7
|
7
|
import { useDispatch } from 'react-redux';
|
|
8
|
8
|
|
|
9
|
9
|
import { Avatar } from '../../../base/avatar';
|
|
10
|
|
-import { isToolbarButtonEnabled } from '../../../base/config';
|
|
11
|
10
|
import { hideDialog, openDialog } from '../../../base/dialog/actions';
|
|
12
|
11
|
import BottomSheet from '../../../base/dialog/components/native/BottomSheet';
|
|
13
|
12
|
import {
|
|
|
@@ -16,7 +15,9 @@ import {
|
|
16
|
15
|
IconMuteEveryoneElse, IconVideoOff
|
|
17
|
16
|
} from '../../../base/icons';
|
|
18
|
17
|
import {
|
|
19
|
|
- getParticipantByIdOrUndefined, getParticipantDisplayName,
|
|
|
18
|
+ getLocalParticipant,
|
|
|
19
|
+ getParticipantByIdOrUndefined,
|
|
|
20
|
+ getParticipantDisplayName, getRemoteParticipants,
|
|
20
|
21
|
isLocalParticipantModerator
|
|
21
|
22
|
} from '../../../base/participants/functions';
|
|
22
|
23
|
import { connect } from '../../../base/redux';
|
|
|
@@ -29,9 +30,9 @@ import {
|
|
29
|
30
|
KickRemoteParticipantDialog,
|
|
30
|
31
|
MuteEveryoneDialog,
|
|
31
|
32
|
MuteRemoteParticipantDialog,
|
|
32
|
|
- MuteRemoteParticipantsVideoDialog,
|
|
33
|
|
- VolumeSlider
|
|
|
33
|
+ MuteRemoteParticipantsVideoDialog
|
|
34
|
34
|
} from '../../../video-menu';
|
|
|
35
|
+import VolumeSlider from '../../../video-menu/components/native/VolumeSlider';
|
|
35
|
36
|
|
|
36
|
37
|
import styles from './styles';
|
|
37
|
38
|
|
|
|
@@ -47,11 +48,6 @@ type Props = {
|
|
47
|
48
|
*/
|
|
48
|
49
|
_isLocalModerator: boolean,
|
|
49
|
50
|
|
|
50
|
|
- /**
|
|
51
|
|
- * True if the chat button is enabled and false otherwise.
|
|
52
|
|
- */
|
|
53
|
|
- _isChatButtonEnabled: boolean,
|
|
54
|
|
-
|
|
55
|
51
|
/**
|
|
56
|
52
|
* True if the participant is moderator and false otherwise.
|
|
57
|
53
|
*/
|
|
|
@@ -67,6 +63,11 @@ type Props = {
|
|
67
|
63
|
*/
|
|
68
|
64
|
_isParticipantAudioMuted: boolean,
|
|
69
|
65
|
|
|
|
66
|
+ /**
|
|
|
67
|
+ * Whether the participant is present in the room or not.
|
|
|
68
|
+ */
|
|
|
69
|
+ _isParticipantIDAvailable?: boolean,
|
|
|
70
|
+
|
|
70
|
71
|
/**
|
|
71
|
72
|
* Participant reference
|
|
72
|
73
|
*/
|
|
|
@@ -78,14 +79,14 @@ type Props = {
|
|
78
|
79
|
participantID: string,
|
|
79
|
80
|
};
|
|
80
|
81
|
|
|
81
|
|
-export const ContextMenuMeetingParticipantDetails = (
|
|
|
82
|
+const ContextMenuMeetingParticipantDetails = (
|
|
82
|
83
|
{
|
|
83
|
84
|
_displayName,
|
|
84
|
85
|
_isLocalModerator,
|
|
85
|
|
- _isChatButtonEnabled,
|
|
86
|
86
|
_isParticipantVideoMuted,
|
|
87
|
87
|
_isParticipantAudioMuted,
|
|
88
|
88
|
_participant,
|
|
|
89
|
+ _isParticipantIDAvailable,
|
|
89
|
90
|
participantID
|
|
90
|
91
|
}: Props) => {
|
|
91
|
92
|
const dispatch = useDispatch();
|
|
|
@@ -121,6 +122,7 @@ export const ContextMenuMeetingParticipantDetails = (
|
|
121
|
122
|
<BottomSheet
|
|
122
|
123
|
addScrollViewPadding = { false }
|
|
123
|
124
|
onCancel = { cancel }
|
|
|
125
|
+ showSlidingView = { _isParticipantIDAvailable }
|
|
124
|
126
|
style = { styles.contextMenuMeetingParticipantDetails }>
|
|
125
|
127
|
<View
|
|
126
|
128
|
style = { styles.contextMenuItemSectionAvatar }>
|
|
|
@@ -196,20 +198,16 @@ export const ContextMenuMeetingParticipantDetails = (
|
|
196
|
198
|
</>
|
|
197
|
199
|
)
|
|
198
|
200
|
}
|
|
199
|
|
- {
|
|
200
|
|
- _isChatButtonEnabled && (
|
|
201
|
|
- <TouchableOpacity
|
|
202
|
|
- onPress = { sendPrivateMessage }
|
|
203
|
|
- style = { styles.contextMenuItem }>
|
|
204
|
|
- <Icon
|
|
205
|
|
- size = { 20 }
|
|
206
|
|
- src = { IconMessage } />
|
|
207
|
|
- <Text style = { styles.contextMenuItemText }>
|
|
208
|
|
- { t('toolbar.accessibilityLabel.privateMessage') }
|
|
209
|
|
- </Text>
|
|
210
|
|
- </TouchableOpacity>
|
|
211
|
|
- )
|
|
212
|
|
- }
|
|
|
201
|
+ <TouchableOpacity
|
|
|
202
|
+ onPress = { sendPrivateMessage }
|
|
|
203
|
+ style = { styles.contextMenuItem }>
|
|
|
204
|
+ <Icon
|
|
|
205
|
+ size = { 20 }
|
|
|
206
|
+ src = { IconMessage } />
|
|
|
207
|
+ <Text style = { styles.contextMenuItemText }>
|
|
|
208
|
+ { t('toolbar.accessibilityLabel.privateMessage') }
|
|
|
209
|
+ </Text>
|
|
|
210
|
+ </TouchableOpacity>
|
|
213
|
211
|
{/* We need design specs for this*/}
|
|
214
|
212
|
{/* <TouchableOpacity*/}
|
|
215
|
213
|
{/* style = { styles.contextMenuItemSection }>*/}
|
|
|
@@ -220,7 +218,7 @@ export const ContextMenuMeetingParticipantDetails = (
|
|
220
|
218
|
{/* <Text style = { styles.contextMenuItemText }>{ t('participantsPane.actions.networkStats') }</Text>*/}
|
|
221
|
219
|
{/* </TouchableOpacity>*/}
|
|
222
|
220
|
<Divider style = { styles.divider } />
|
|
223
|
|
- <VolumeSlider participant = { _participant } />
|
|
|
221
|
+ <VolumeSlider participantID = { participantID } />
|
|
224
|
222
|
</BottomSheet>
|
|
225
|
223
|
);
|
|
226
|
224
|
};
|
|
|
@@ -236,17 +234,28 @@ export const ContextMenuMeetingParticipantDetails = (
|
|
236
|
234
|
*/
|
|
237
|
235
|
function _mapStateToProps(state, ownProps): Object {
|
|
238
|
236
|
const { participantID } = ownProps;
|
|
|
237
|
+ const participantIDS = [];
|
|
|
238
|
+
|
|
239
|
239
|
const participant = getParticipantByIdOrUndefined(state, participantID);
|
|
240
|
240
|
const _isLocalModerator = isLocalParticipantModerator(state);
|
|
241
|
|
- const _isChatButtonEnabled = isToolbarButtonEnabled('chat', state);
|
|
242
|
241
|
const _isParticipantVideoMuted = isParticipantVideoMuted(participant, state);
|
|
243
|
242
|
const _isParticipantAudioMuted = isParticipantAudioMuted(participant, state);
|
|
|
243
|
+ const localParticipant = getLocalParticipant(state);
|
|
|
244
|
+ const remoteParticipants = getRemoteParticipants(state);
|
|
|
245
|
+
|
|
|
246
|
+ localParticipant && participantIDS.push(localParticipant?.id);
|
|
|
247
|
+
|
|
|
248
|
+ remoteParticipants.forEach(p => {
|
|
|
249
|
+ participantIDS.push(p?.id);
|
|
|
250
|
+ });
|
|
|
251
|
+
|
|
|
252
|
+ const isParticipantIDAvailable = participantIDS.find(partID => partID === participantID);
|
|
244
|
253
|
|
|
245
|
254
|
return {
|
|
246
|
255
|
_displayName: getParticipantDisplayName(state, participantID),
|
|
247
|
256
|
_isLocalModerator,
|
|
248
|
|
- _isChatButtonEnabled,
|
|
249
|
257
|
_isParticipantAudioMuted,
|
|
|
258
|
+ _isParticipantIDAvailable: Boolean(isParticipantIDAvailable),
|
|
250
|
259
|
_isParticipantVideoMuted,
|
|
251
|
260
|
_participant: participant
|
|
252
|
261
|
};
|