|
@@ -4,26 +4,37 @@ import React, { useCallback } from 'react';
|
4
|
4
|
import { useTranslation } from 'react-i18next';
|
5
|
5
|
import { ScrollView, View } from 'react-native';
|
6
|
6
|
import { Button } from 'react-native-paper';
|
7
|
|
-import { useDispatch, useSelector } from 'react-redux';
|
|
7
|
+import { useDispatch, useSelector, connect } from 'react-redux';
|
8
|
8
|
|
9
|
9
|
import { hideDialog, openDialog } from '../../../base/dialog';
|
10
|
10
|
import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
|
11
|
11
|
import { JitsiModal } from '../../../base/modal';
|
12
|
|
-import { isLocalParticipantModerator } from '../../../base/participants';
|
|
12
|
+import {
|
|
13
|
+ isLocalParticipantModerator
|
|
14
|
+} from '../../../base/participants';
|
13
|
15
|
import MuteEveryoneDialog
|
14
|
16
|
from '../../../video-menu/components/native/MuteEveryoneDialog';
|
|
17
|
+import { PARTICIPANTS_PANE_ID } from '../../constants';
|
15
|
18
|
|
16
|
19
|
import { ContextMenuMore } from './ContextMenuMore';
|
17
|
20
|
import { LobbyParticipantList } from './LobbyParticipantList';
|
18
|
21
|
import { MeetingParticipantList } from './MeetingParticipantList';
|
19
|
22
|
import styles from './styles';
|
20
|
23
|
|
|
24
|
+type Props = {
|
|
25
|
+
|
|
26
|
+ /**
|
|
27
|
+ * Is the participants pane open
|
|
28
|
+ */
|
|
29
|
+ _isOpen: boolean
|
|
30
|
+};
|
|
31
|
+
|
21
|
32
|
/**
|
22
|
33
|
* Participant pane.
|
23
|
34
|
*
|
24
|
35
|
* @returns {React$Element<any>}
|
25
|
36
|
*/
|
26
|
|
-function ParticipantsPane() {
|
|
37
|
+function ParticipantsPane({ _isOpen: paneOpen }: Props) {
|
27
|
38
|
const dispatch = useDispatch();
|
28
|
39
|
const openMoreMenu = useCallback(() => dispatch(openDialog(ContextMenuMore)), [ dispatch ]);
|
29
|
40
|
const closePane = useCallback(() => dispatch(hideDialog()), [ dispatch ]);
|
|
@@ -33,8 +44,10 @@ function ParticipantsPane() {
|
33
|
44
|
const { t } = useTranslation();
|
34
|
45
|
|
35
|
46
|
return (
|
36
|
|
- <JitsiModal
|
|
47
|
+ paneOpen
|
|
48
|
+ && <JitsiModal
|
37
|
49
|
hideHeaderWithNavigation = { true }
|
|
50
|
+ modalId = { PARTICIPANTS_PANE_ID }
|
38
|
51
|
style = { styles.participantsPane }>
|
39
|
52
|
<View style = { styles.header }>
|
40
|
53
|
<Button
|
|
@@ -80,5 +93,23 @@ function ParticipantsPane() {
|
80
|
93
|
);
|
81
|
94
|
}
|
82
|
95
|
|
|
96
|
+/**
|
|
97
|
+ * Maps (parts of) the redux state to {@link ParticipantsPane} React {@code Component}
|
|
98
|
+ * props.
|
|
99
|
+ *
|
|
100
|
+ * @param {Object} state - The redux store/state.
|
|
101
|
+ * @private
|
|
102
|
+ * @returns {{
|
|
103
|
+ * _isOpen: boolean,
|
|
104
|
+ * }}
|
|
105
|
+ */
|
|
106
|
+function _mapStateToProps(state: Object) {
|
|
107
|
+ const { isOpen } = state['features/participants-pane'];
|
|
108
|
+
|
|
109
|
+ return {
|
|
110
|
+ _isOpen: isOpen
|
|
111
|
+ };
|
|
112
|
+}
|
|
113
|
+
|
83
|
114
|
|
84
|
|
-export default ParticipantsPane;
|
|
115
|
+export default connect(_mapStateToProps)(ParticipantsPane);
|