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
 import '../lobby/reducer';
40
 import '../lobby/reducer';
41
 import '../notifications/reducer';
41
 import '../notifications/reducer';
42
 import '../overlay/reducer';
42
 import '../overlay/reducer';
43
+import '../participants-pane/reducer';
43
 import '../reactions/reducer';
44
 import '../reactions/reducer';
44
 import '../recent-list/reducer';
45
 import '../recent-list/reducer';
45
 import '../recording/reducer';
46
 import '../recording/reducer';

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

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

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

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
+// @flow
2
+
1
 import { openDialog } from '../base/dialog';
3
 import { openDialog } from '../base/dialog';
2
 
4
 
3
-import { PARTICIPANTS_PANE_CLOSE, PARTICIPANTS_PANE_OPEN } from './actionTypes';
4
 import { ContextMenuLobbyParticipantReject, ContextMenuMeetingParticipantDetails } from './components/native';
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
  * Displays the context menu for the selected lobby participant.
9
  * Displays the context menu for the selected lobby participant.
34
  * @param {Object} participant - The selected lobby participant.
11
  * @param {Object} participant - The selected lobby participant.
35
  * @returns {Function}
12
  * @returns {Function}
36
  */
13
  */
37
-export function showContextMenuReject(participant) {
14
+export function showContextMenuReject(participant: Object) {
38
     return openDialog(ContextMenuLobbyParticipantReject, { participant });
15
     return openDialog(ContextMenuLobbyParticipantReject, { participant });
39
 }
16
 }
40
 
17
 
45
  * @param {Object} participant - The selected meeting participant.
22
  * @param {Object} participant - The selected meeting participant.
46
  * @returns {Function}
23
  * @returns {Function}
47
  */
24
  */
48
-export function showContextMenuDetails(participant) {
25
+export function showContextMenuDetails(participant: Object) {
49
     return openDialog(ContextMenuMeetingParticipantDetails, { participant });
26
     return openDialog(ContextMenuMeetingParticipantDetails, { participant });
50
 }
27
 }

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

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
 import { useTranslation } from 'react-i18next';
4
 import { useTranslation } from 'react-i18next';
5
 import { ScrollView, View } from 'react-native';
5
 import { ScrollView, View } from 'react-native';
6
 import { Button } from 'react-native-paper';
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
 import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
10
 import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
11
 import { JitsiModal } from '../../../base/modal';
11
 import { JitsiModal } from '../../../base/modal';
12
 import {
12
 import {
14
 } from '../../../base/participants';
14
 } from '../../../base/participants';
15
 import MuteEveryoneDialog
15
 import MuteEveryoneDialog
16
     from '../../../video-menu/components/native/MuteEveryoneDialog';
16
     from '../../../video-menu/components/native/MuteEveryoneDialog';
17
-import { PARTICIPANTS_PANE_ID } from '../../constants';
17
+import { close } from '../../actions.native';
18
 
18
 
19
 import { ContextMenuMore } from './ContextMenuMore';
19
 import { ContextMenuMore } from './ContextMenuMore';
20
 import { LobbyParticipantList } from './LobbyParticipantList';
20
 import { LobbyParticipantList } from './LobbyParticipantList';
21
 import { MeetingParticipantList } from './MeetingParticipantList';
21
 import { MeetingParticipantList } from './MeetingParticipantList';
22
 import styles from './styles';
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
  * Participant pane.
25
  * Participant pane.
34
  *
26
  *
35
  * @returns {React$Element<any>}
27
  * @returns {React$Element<any>}
36
  */
28
  */
37
-function ParticipantsPane({ _isOpen: paneOpen }: Props) {
29
+const ParticipantsPane = () => {
38
     const dispatch = useDispatch();
30
     const dispatch = useDispatch();
39
     const openMoreMenu = useCallback(() => dispatch(openDialog(ContextMenuMore)), [ dispatch ]);
31
     const openMoreMenu = useCallback(() => dispatch(openDialog(ContextMenuMore)), [ dispatch ]);
40
-    const closePane = useCallback(() => dispatch(hideDialog()), [ dispatch ]);
32
+    const closePane = useCallback(() => dispatch(close()), [ dispatch ]);
41
     const isLocalModerator = useSelector(isLocalParticipantModerator);
33
     const isLocalModerator = useSelector(isLocalParticipantModerator);
42
     const muteAll = useCallback(() => dispatch(openDialog(MuteEveryoneDialog)),
34
     const muteAll = useCallback(() => dispatch(openDialog(MuteEveryoneDialog)),
43
         [ dispatch ]);
35
         [ dispatch ]);
44
     const { t } = useTranslation();
36
     const { t } = useTranslation();
45
 
37
 
46
     return (
38
     return (
47
-        paneOpen
48
-        && <JitsiModal
39
+        <JitsiModal
49
             hideHeaderWithNavigation = { true }
40
             hideHeaderWithNavigation = { true }
50
-            modalId = { PARTICIPANTS_PANE_ID }
51
             style = { styles.participantsPane }>
41
             style = { styles.participantsPane }>
52
             <View style = { styles.header }>
42
             <View style = { styles.header }>
53
                 <Button
43
                 <Button
91
             }
81
             }
92
         </JitsiModal>
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
      * @returns {void}
32
      * @returns {void}
33
      */
33
      */
34
     _handleClick() {
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
 // @flow
1
 // @flow
2
 
2
 
3
-export const PARTICIPANTS_PANE_ID = 'participantsPane';
4
-
5
 /**
3
 /**
6
  * Reducer key for the feature.
4
  * Reducer key for the feature.
7
  */
5
  */

Loading…
Cancel
Save