|
@@ -1,6 +1,6 @@
|
1
|
1
|
// @flow
|
2
|
2
|
|
3
|
|
-import React, { useCallback, useState } from 'react';
|
|
3
|
+import React, { useCallback } from 'react';
|
4
|
4
|
import { useTranslation } from 'react-i18next';
|
5
|
5
|
import { TouchableOpacity, View } from 'react-native';
|
6
|
6
|
import { Divider, Text } from 'react-native-paper';
|
|
@@ -20,7 +20,6 @@ import {
|
20
|
20
|
} from '../../../base/participants';
|
21
|
21
|
import { getIsParticipantVideoMuted } from '../../../base/tracks';
|
22
|
22
|
import { openChat } from '../../../chat/actions.native';
|
23
|
|
-import { getParticipantsVolume } from '../../../filmstrip';
|
24
|
23
|
import {
|
25
|
24
|
KickRemoteParticipantDialog,
|
26
|
25
|
MuteEveryoneDialog,
|
|
@@ -40,17 +39,14 @@ type Props = {
|
40
|
39
|
};
|
41
|
40
|
|
42
|
41
|
export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props) => {
|
43
|
|
- const [ volume, setVolume ] = useState(0);
|
44
|
42
|
const dispatch = useDispatch();
|
45
|
43
|
const cancel = useCallback(() => dispatch(hideDialog()), [ dispatch ]);
|
46
|
|
- const participantsVolume = useSelector(getParticipantsVolume)[p.id];
|
47
|
|
- const changeVolume = useCallback(() => {
|
48
|
|
- setVolume(volume + 1);
|
49
|
|
- }, [ volume ]);
|
|
44
|
+ const isStartingSilent = useSelector(getIsStartingSilent);
|
|
45
|
+ const participantsVolume = 1;
|
|
46
|
+ const initialParticipantsVolume = isStartingSilent ? undefined : participantsVolume;
|
50
|
47
|
const displayName = p.name;
|
51
|
48
|
const isLocalModerator = useSelector(isLocalParticipantModerator);
|
52
|
49
|
const isParticipantVideoMuted = useSelector(getIsParticipantVideoMuted(p));
|
53
|
|
- const isStartingSilent = useSelector(getIsStartingSilent);
|
54
|
50
|
|
55
|
51
|
const kickRemoteParticipant = useCallback(() => {
|
56
|
52
|
dispatch(openDialog(KickRemoteParticipantDialog, {
|
|
@@ -72,7 +68,7 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
|
72
|
68
|
participantID: p.id
|
73
|
69
|
}));
|
74
|
70
|
}, [ dispatch, p ]);
|
75
|
|
- const onVolumeChange = isStartingSilent ? undefined : changeVolume;
|
|
71
|
+
|
76
|
72
|
const sendPrivateMessage = useCallback(() => {
|
77
|
73
|
dispatch(hideDialog());
|
78
|
74
|
dispatch(openChat(p));
|
|
@@ -177,8 +173,7 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
|
177
|
173
|
{/* </TouchableOpacity>*/}
|
178
|
174
|
<Divider style = { styles.divider } />
|
179
|
175
|
<VolumeSlider
|
180
|
|
- initialValue = { participantsVolume }
|
181
|
|
- onChange = { onVolumeChange } />
|
|
176
|
+ initialValue = { initialParticipantsVolume } />
|
182
|
177
|
</BottomSheet>
|
183
|
178
|
);
|
184
|
179
|
};
|