Browse Source

feat(native-participants-pane) participants pane open/close fixed

master
Calin Chitu 4 years ago
parent
commit
a12ad99ecf

+ 1
- 0
react/features/app/reducers.any.js View File

@@ -40,6 +40,7 @@ import '../large-video/reducer';
40 40
 import '../lobby/reducer';
41 41
 import '../notifications/reducer';
42 42
 import '../overlay/reducer';
43
+import '../participants-pane/reducer';
43 44
 import '../reactions/reducer';
44 45
 import '../recent-list/reducer';
45 46
 import '../recording/reducer';

+ 10
- 1
react/features/conference/components/native/Conference.js View File

@@ -23,6 +23,7 @@ import { AddPeopleDialog, CalleeInfoContainer } from '../../../invite';
23 23
 import { LargeVideo } from '../../../large-video';
24 24
 import { KnockingParticipantList } from '../../../lobby';
25 25
 import { BackButtonRegistry } from '../../../mobile/back-button';
26
+import { ParticipantsPane } from '../../../participants-pane/components/native';
26 27
 import { Captions } from '../../../subtitles';
27 28
 import { setToolboxVisible } from '../../../toolbox/actions';
28 29
 import { Toolbox } from '../../../toolbox/components/native';
@@ -71,6 +72,8 @@ type Props = AbstractProps & {
71 72
      */
72 73
     _fullscreenEnabled: boolean,
73 74
 
75
+    _isOpen: boolean,
76
+
74 77
     /**
75 78
      * The ID of the participant currently on stage (if any)
76 79
      */
@@ -237,6 +240,7 @@ class Conference extends AbstractConference<Props, *> {
237 240
     _renderContent() {
238 241
         const {
239 242
             _connecting,
243
+            _isOpen,
240 244
             _largeVideoParticipantId,
241 245
             _reducedUI,
242 246
             _shouldDisplayTileView
@@ -296,11 +300,14 @@ class Conference extends AbstractConference<Props, *> {
296 300
                 </SafeAreaView>
297 301
 
298 302
                 <TestConnectionInfo />
299
-
300 303
                 { this._renderConferenceNotification() }
301 304
 
302 305
                 { this._renderConferenceModals() }
306
+
303 307
                 {_shouldDisplayTileView && <Toolbox />}
308
+
309
+                { _isOpen && <ParticipantsPane /> }
310
+
304 311
             </>
305 312
         );
306 313
     }
@@ -384,6 +391,7 @@ class Conference extends AbstractConference<Props, *> {
384 391
  * @returns {Props}
385 392
  */
386 393
 function _mapStateToProps(state) {
394
+    const { isOpen } = state['features/participants-pane'];
387 395
     const { connecting, connection } = state['features/base/connection'];
388 396
     const {
389 397
         conference,
@@ -412,6 +420,7 @@ function _mapStateToProps(state) {
412 420
         _connecting: Boolean(connecting_),
413 421
         _filmstripVisible: isFilmstripVisible(state),
414 422
         _fullscreenEnabled: getFeatureFlag(state, FULLSCREEN_ENABLED, true),
423
+        _isOpen: isOpen,
415 424
         _largeVideoParticipantId: state['features/large-video'].participantId,
416 425
         _pictureInPictureEnabled: getFeatureFlag(state, PIP_ENABLED),
417 426
         _reducedUI: reducedUI,

+ 28
- 0
react/features/participants-pane/actions.any.js View File

@@ -0,0 +1,28 @@
1
+// @flow
2
+
3
+import {
4
+    PARTICIPANTS_PANE_CLOSE,
5
+    PARTICIPANTS_PANE_OPEN
6
+} from './actionTypes';
7
+
8
+/**
9
+ * Action to close the participants pane.
10
+ *
11
+ * @returns {Object}
12
+ */
13
+export const close = () => {
14
+    return {
15
+        type: PARTICIPANTS_PANE_CLOSE
16
+    };
17
+};
18
+
19
+/**
20
+ * Action to open the participants pane.
21
+ *
22
+ * @returns {Object}
23
+ */
24
+export const open = () => {
25
+    return {
26
+        type: PARTICIPANTS_PANE_OPEN
27
+    };
28
+};

+ 5
- 28
react/features/participants-pane/actions.native.js View File

@@ -1,32 +1,9 @@
1
+// @flow
2
+
1 3
 import { openDialog } from '../base/dialog';
2 4
 
3
-import { PARTICIPANTS_PANE_CLOSE, PARTICIPANTS_PANE_OPEN } from './actionTypes';
4 5
 import { ContextMenuLobbyParticipantReject, ContextMenuMeetingParticipantDetails } from './components/native';
5
-
6
-
7
-/**
8
- * Action to open the participants pane.
9
- *
10
- * @returns {Object}
11
- */
12
-export function open() {
13
-    console.log(2);
14
-
15
-    return {
16
-        type: PARTICIPANTS_PANE_OPEN
17
-    };
18
-}
19
-
20
-/**
21
- * Action to close the participants pane.
22
- *
23
- * @returns {Object}
24
- */
25
-export function close() {
26
-    return {
27
-        type: PARTICIPANTS_PANE_CLOSE
28
-    };
29
-}
6
+export * from './actions.any';
30 7
 
31 8
 /**
32 9
  * Displays the context menu for the selected lobby participant.
@@ -34,7 +11,7 @@ export function close() {
34 11
  * @param {Object} participant - The selected lobby participant.
35 12
  * @returns {Function}
36 13
  */
37
-export function showContextMenuReject(participant) {
14
+export function showContextMenuReject(participant: Object) {
38 15
     return openDialog(ContextMenuLobbyParticipantReject, { participant });
39 16
 }
40 17
 
@@ -45,6 +22,6 @@ export function showContextMenuReject(participant) {
45 22
  * @param {Object} participant - The selected meeting participant.
46 23
  * @returns {Function}
47 24
  */
48
-export function showContextMenuDetails(participant) {
25
+export function showContextMenuDetails(participant: Object) {
49 26
     return openDialog(ContextMenuMeetingParticipantDetails, { participant });
50 27
 }

+ 2
- 25
react/features/participants-pane/actions.web.js View File

@@ -1,26 +1,3 @@
1
-import {
2
-    PARTICIPANTS_PANE_CLOSE,
3
-    PARTICIPANTS_PANE_OPEN
4
-} from './actionTypes';
1
+// @flow
5 2
 
6
-/**
7
- * Action to close the participants pane.
8
- *
9
- * @returns {Object}
10
- */
11
-export const close = () => {
12
-    return {
13
-        type: PARTICIPANTS_PANE_CLOSE
14
-    };
15
-};
16
-
17
-/**
18
- * Action to open the participants pane.
19
- *
20
- * @returns {Object}
21
- */
22
-export const open = () => {
23
-    return {
24
-        type: PARTICIPANTS_PANE_OPEN
25
-    };
26
-};
3
+export * from './actions.any';

+ 8
- 37
react/features/participants-pane/components/native/ParticipantsPane.js View File

@@ -4,9 +4,9 @@ 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, connect } from 'react-redux';
7
+import { useDispatch, useSelector } from 'react-redux';
8 8
 
9
-import { hideDialog, openDialog } from '../../../base/dialog';
9
+import { openDialog } from '../../../base/dialog';
10 10
 import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
11 11
 import { JitsiModal } from '../../../base/modal';
12 12
 import {
@@ -14,40 +14,30 @@ import {
14 14
 } from '../../../base/participants';
15 15
 import MuteEveryoneDialog
16 16
     from '../../../video-menu/components/native/MuteEveryoneDialog';
17
-import { PARTICIPANTS_PANE_ID } from '../../constants';
17
+import { close } from '../../actions.native';
18 18
 
19 19
 import { ContextMenuMore } from './ContextMenuMore';
20 20
 import { LobbyParticipantList } from './LobbyParticipantList';
21 21
 import { MeetingParticipantList } from './MeetingParticipantList';
22 22
 import styles from './styles';
23 23
 
24
-type Props = {
25
-
26
-    /**
27
-     * Is the participants pane open
28
-     */
29
-    _isOpen: boolean
30
-};
31
-
32 24
 /**
33 25
  * Participant pane.
34 26
  *
35 27
  * @returns {React$Element<any>}
36 28
  */
37
-function ParticipantsPane({ _isOpen: paneOpen }: Props) {
29
+const ParticipantsPane = () => {
38 30
     const dispatch = useDispatch();
39 31
     const openMoreMenu = useCallback(() => dispatch(openDialog(ContextMenuMore)), [ dispatch ]);
40
-    const closePane = useCallback(() => dispatch(hideDialog()), [ dispatch ]);
32
+    const closePane = useCallback(() => dispatch(close()), [ dispatch ]);
41 33
     const isLocalModerator = useSelector(isLocalParticipantModerator);
42 34
     const muteAll = useCallback(() => dispatch(openDialog(MuteEveryoneDialog)),
43 35
         [ dispatch ]);
44 36
     const { t } = useTranslation();
45 37
 
46 38
     return (
47
-        paneOpen
48
-        && <JitsiModal
39
+        <JitsiModal
49 40
             hideHeaderWithNavigation = { true }
50
-            modalId = { PARTICIPANTS_PANE_ID }
51 41
             style = { styles.participantsPane }>
52 42
             <View style = { styles.header }>
53 43
                 <Button
@@ -91,25 +81,6 @@ function ParticipantsPane({ _isOpen: paneOpen }: Props) {
91 81
             }
92 82
         </JitsiModal>
93 83
     );
94
-}
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
-
84
+};
114 85
 
115
-export default connect(_mapStateToProps)(ParticipantsPane);
86
+export default ParticipantsPane;

+ 3
- 1
react/features/participants-pane/components/native/ParticipantsPaneButton.js View File

@@ -32,7 +32,9 @@ class ParticipantsPaneButton extends AbstractButton<Props, *> {
32 32
      * @returns {void}
33 33
      */
34 34
     _handleClick() {
35
-        this.props.dispatch(open());
35
+        const { dispatch } = this.props;
36
+
37
+        dispatch(open());
36 38
     }
37 39
 }
38 40
 

+ 0
- 2
react/features/participants-pane/constants.js View File

@@ -1,7 +1,5 @@
1 1
 // @flow
2 2
 
3
-export const PARTICIPANTS_PANE_ID = 'participantsPane';
4
-
5 3
 /**
6 4
  * Reducer key for the feature.
7 5
  */

Loading…
Cancel
Save