|
|
@@ -1,13 +1,12 @@
|
|
1
|
1
|
// @flow
|
|
2
|
2
|
|
|
3
|
|
-import React, { useCallback } from 'react';
|
|
|
3
|
+import React, { useCallback, useState } from 'react';
|
|
4
|
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
5
|
import { TouchableOpacity, View } from 'react-native';
|
|
6
|
6
|
import { Text } from 'react-native-paper';
|
|
7
|
|
-import { useDispatch, useSelector } from 'react-redux';
|
|
|
7
|
+import { useDispatch, useSelector, useStore } 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';
|
|
12
|
11
|
import BottomSheet from '../../../base/dialog/components/native/BottomSheet';
|
|
13
|
12
|
import {
|
|
|
@@ -37,11 +36,14 @@ type Props = {
|
|
37
|
36
|
};
|
|
38
|
37
|
|
|
39
|
38
|
export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props) => {
|
|
|
39
|
+ const [ volume, setVolume ] = useState(undefined);
|
|
|
40
|
+ const store = useStore();
|
|
|
41
|
+ const startSilent = store.getState['features/base/config'];
|
|
40
|
42
|
const dispatch = useDispatch();
|
|
41
|
43
|
const cancel = useCallback(() => dispatch(hideDialog()), [ dispatch ]);
|
|
|
44
|
+ const changeVolume = useCallback(() => setVolume(volume), [ volume ]);
|
|
42
|
45
|
const displayName = p.name;
|
|
43
|
46
|
const isLocalModerator = useSelector(isLocalParticipantModerator);
|
|
44
|
|
- const isChatButtonEnabled = useSelector(isToolbarButtonEnabled('chat'));
|
|
45
|
47
|
const isParticipantVideoMuted = useSelector(getIsParticipantVideoMuted(p));
|
|
46
|
48
|
const kickRemoteParticipant = useCallback(() => {
|
|
47
|
49
|
dispatch(openDialog(KickRemoteParticipantDialog, {
|
|
|
@@ -63,7 +65,9 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
|
|
63
|
65
|
participantID: p.id
|
|
64
|
66
|
}));
|
|
65
|
67
|
}, [ dispatch, p ]);
|
|
|
68
|
+ const onVolumeChange = startSilent ? undefined : changeVolume;
|
|
66
|
69
|
const sendPrivateMessage = useCallback(() => {
|
|
|
70
|
+ dispatch(hideDialog());
|
|
67
|
71
|
dispatch(openChat(p));
|
|
68
|
72
|
}, [ dispatch, p ]);
|
|
69
|
73
|
const { t } = useTranslation();
|
|
|
@@ -142,20 +146,17 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
|
|
142
|
146
|
</Text>
|
|
143
|
147
|
</TouchableOpacity>
|
|
144
|
148
|
}
|
|
145
|
|
- {
|
|
146
|
|
- isChatButtonEnabled
|
|
147
|
|
- && <TouchableOpacity
|
|
148
|
|
- onPress = { sendPrivateMessage }
|
|
149
|
|
- style = { styles.contextMenuItem }>
|
|
150
|
|
- <Icon
|
|
151
|
|
- size = { 24 }
|
|
152
|
|
- src = { IconMessage }
|
|
153
|
|
- style = { styles.contextMenuItemIcon } />
|
|
154
|
|
- <Text style = { styles.contextMenuItemText }>
|
|
155
|
|
- { t('toolbar.accessibilityLabel.privateMessage') }
|
|
156
|
|
- </Text>
|
|
157
|
|
- </TouchableOpacity>
|
|
158
|
|
- }
|
|
|
149
|
+ <TouchableOpacity
|
|
|
150
|
+ onPress = { sendPrivateMessage }
|
|
|
151
|
+ style = { styles.contextMenuItem }>
|
|
|
152
|
+ <Icon
|
|
|
153
|
+ size = { 24 }
|
|
|
154
|
+ src = { IconMessage }
|
|
|
155
|
+ style = { styles.contextMenuItemIcon } />
|
|
|
156
|
+ <Text style = { styles.contextMenuItemText }>
|
|
|
157
|
+ { t('toolbar.accessibilityLabel.privateMessage') }
|
|
|
158
|
+ </Text>
|
|
|
159
|
+ </TouchableOpacity>
|
|
159
|
160
|
<TouchableOpacity
|
|
160
|
161
|
style = { styles.contextMenuItemSection }>
|
|
161
|
162
|
<Icon
|
|
|
@@ -164,7 +165,9 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
|
|
164
|
165
|
style = { styles.contextMenuItemIcon } />
|
|
165
|
166
|
<Text style = { styles.contextMenuItemText }>{ t('participantsPane.actions.networkStats') }</Text>
|
|
166
|
167
|
</TouchableOpacity>
|
|
167
|
|
- <VolumeSlider />
|
|
|
168
|
+ <VolumeSlider
|
|
|
169
|
+ initialValue = { volume }
|
|
|
170
|
+ onChange = { onVolumeChange } />
|
|
168
|
171
|
</BottomSheet>
|
|
169
|
172
|
);
|
|
170
|
173
|
};
|