浏览代码

feat(native-participants-pane) removed mock data

master
Calin Chitu 4 年前
父节点
当前提交
14a5c45fa3

+ 2
- 2
react/features/participants-pane/components/native/ContextMenuLobbyParticipantReject.js 查看文件

@@ -39,7 +39,7 @@ export const ContextMenuLobbyParticipantReject = ({ participant: p }: Props) =>
39 39
                 <Avatar
40 40
                     className = 'participant-avatar'
41 41
                     participantId = { p.id }
42
-                    size = { 24 } />
42
+                    size = { 20 } />
43 43
                 <View style = { styles.contextMenuItemText }>
44 44
                     <Text style = { styles.contextMenuItemName }>
45 45
                         { displayName }
@@ -51,7 +51,7 @@ export const ContextMenuLobbyParticipantReject = ({ participant: p }: Props) =>
51 51
                 onPress = { reject }
52 52
                 style = { styles.contextMenuItem }>
53 53
                 <Icon
54
-                    size = { 24 }
54
+                    size = { 20 }
55 55
                     src = { IconClose }
56 56
                     style = { styles.contextMenuItemIcon } />
57 57
                 <Text style = { styles.contextMenuItemText }>{ t('lobby.reject') }</Text>

+ 7
- 7
react/features/participants-pane/components/native/ContextMenuMeetingParticipantDetails.js 查看文件

@@ -81,7 +81,7 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
81 81
                 <Avatar
82 82
                     className = 'participant-avatar'
83 83
                     participantId = { p.id }
84
-                    size = { 24 } />
84
+                    size = { 20 } />
85 85
                 <View style = { styles.contextMenuItemText }>
86 86
                     <Text style = { styles.contextMenuItemName }>
87 87
                         { displayName }
@@ -95,7 +95,7 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
95 95
                     onPress = { muteAudio }
96 96
                     style = { styles.contextMenuItem }>
97 97
                     <Icon
98
-                        size = { 24 }
98
+                        size = { 20 }
99 99
                         src = { IconMicrophoneEmptySlash }
100 100
                         style = { styles.contextMenuItemIcon } />
101 101
                     <Text style = { styles.contextMenuItemText }>
@@ -109,7 +109,7 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
109 109
                     onPress = { muteEveryoneElse }
110 110
                     style = { styles.contextMenuItem }>
111 111
                     <Icon
112
-                        size = { 24 }
112
+                        size = { 20 }
113 113
                         src = { IconMuteEveryoneElse }
114 114
                         style = { styles.contextMenuItemIcon } />
115 115
                     <Text style = { styles.contextMenuItemText }>
@@ -125,7 +125,7 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
125 125
                         onPress = { muteVideo }
126 126
                         style = { styles.contextMenuItemSection }>
127 127
                         <Icon
128
-                            size = { 24 }
128
+                            size = { 20 }
129 129
                             src = { IconVideoOff }
130 130
                             style = { styles.contextMenuItemIcon } />
131 131
                         <Text style = { styles.contextMenuItemText }>
@@ -140,7 +140,7 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
140 140
                     onPress = { kickRemoteParticipant }
141 141
                     style = { styles.contextMenuItem }>
142 142
                     <Icon
143
-                        size = { 24 }
143
+                        size = { 20 }
144 144
                         src = { IconCloseCircle }
145 145
                         style = { styles.contextMenuItemIcon } />
146 146
                     <Text style = { styles.contextMenuItemText }>
@@ -152,7 +152,7 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
152 152
                 onPress = { sendPrivateMessage }
153 153
                 style = { styles.contextMenuItem }>
154 154
                 <Icon
155
-                    size = { 24 }
155
+                    size = { 20 }
156 156
                     src = { IconMessage }
157 157
                     style = { styles.contextMenuItemIcon } />
158 158
                 <Text style = { styles.contextMenuItemText }>
@@ -162,7 +162,7 @@ export const ContextMenuMeetingParticipantDetails = ({ participant: p }: Props)
162 162
             <TouchableOpacity
163 163
                 style = { styles.contextMenuItemSection }>
164 164
                 <Icon
165
-                    size = { 24 }
165
+                    size = { 20 }
166 166
                     src = { IconConnectionActive }
167 167
                     style = { styles.contextMenuItemIcon } />
168 168
                 <Text style = { styles.contextMenuItemText }>{ t('participantsPane.actions.networkStats') }</Text>

+ 2
- 2
react/features/participants-pane/components/native/ContextMenuMore.js 查看文件

@@ -45,14 +45,14 @@ export const ContextMenuMore = ({ exclude }: Props) => {
45 45
                 onPress = { muteEveryoneVideo }
46 46
                 style = { styles.contextMenuItem }>
47 47
                 <Icon
48
-                    size = { 24 }
48
+                    size = { 20 }
49 49
                     src = { IconVideoOff } />
50 50
                 <Text style = { styles.contextMenuItemText }>{t('participantsPane.actions.stopEveryonesVideo')}</Text>
51 51
             </TouchableOpacity>
52 52
             <TouchableOpacity
53 53
                 style = { styles.contextMenuItem }>
54 54
                 <Icon
55
-                    size = { 24 }
55
+                    size = { 20 }
56 56
                     src = { IconMicDisabledHollow }
57 57
                     style = { styles.contextMenuIcon } />
58 58
                 <Text style = { styles.contextMenuItemText }>{t('participantsPane.actions.dontAllowUnmute')}</Text>

+ 21
- 8
react/features/participants-pane/components/native/LobbyParticipantList.js 查看文件

@@ -4,19 +4,30 @@ import React, { useCallback } from 'react';
4 4
 import { useTranslation } from 'react-i18next';
5 5
 import { Text, View } from 'react-native';
6 6
 import { Button } from 'react-native-paper';
7
-import { useDispatch } from 'react-redux';
7
+import { useDispatch, useSelector } from 'react-redux';
8 8
 
9
+import { getLobbyState } from '../../../lobby/functions';
9 10
 import { admitAllKnockingParticipants } from '../../../video-menu/actions.any';
10 11
 
11 12
 import { LobbyParticipantItem } from './LobbyParticipantItem';
12
-import { participants } from './participants';
13 13
 import styles from './styles';
14 14
 
15 15
 export const LobbyParticipantList = () => {
16
+    const {
17
+        lobbyEnabled,
18
+        knockingParticipants: participants
19
+    } = useSelector(getLobbyState);
20
+
16 21
     const dispatch = useDispatch();
17
-    const admitAll = useCallback(() => dispatch(admitAllKnockingParticipants()), [ dispatch ]);
22
+    const admitAll = useCallback(() =>
23
+        dispatch(admitAllKnockingParticipants(participants, lobbyEnabled)),
24
+        [ dispatch ]);
18 25
     const { t } = useTranslation();
19 26
 
27
+    if (!lobbyEnabled || !participants.length) {
28
+        return null;
29
+    }
30
+
20 31
     return (
21 32
         <View style = { styles.lobbyList }>
22 33
             <View style = { styles.lobbyListDetails } >
@@ -33,11 +44,13 @@ export const LobbyParticipantList = () => {
33 44
                     {t('lobby.admitAll')}
34 45
                 </Button>
35 46
             </View>
36
-            { participants.map(p => (
37
-                <LobbyParticipantItem
38
-                    key = { p.id }
39
-                    participant = { p } />)
40
-            )}
47
+            {
48
+                participants.map(p => (
49
+                    <LobbyParticipantItem
50
+                        key = { p.id }
51
+                        participant = { p } />)
52
+                )
53
+            }
41 54
         </View>
42 55
     );
43 56
 };

+ 30
- 24
react/features/participants-pane/components/native/MeetingParticipantList.js 查看文件

@@ -4,22 +4,23 @@ import React, { useCallback } from 'react';
4 4
 import { useTranslation } from 'react-i18next';
5 5
 import { Text, View } from 'react-native';
6 6
 import { Button } from 'react-native-paper';
7
-import { useDispatch } from 'react-redux';
7
+import { useDispatch, useSelector, useStore } from 'react-redux';
8 8
 
9
-import { createToolbarEvent, sendAnalytics } from '../../../analytics';
10 9
 import { Icon, IconInviteMore } from '../../../base/icons';
10
+import { getParticipants } from '../../../base/participants';
11 11
 import { doInvitePeople } from '../../../invite/actions.native';
12
+import { shouldRenderInviteButton } from '../../functions';
12 13
 
13 14
 import { MeetingParticipantItem } from './MeetingParticipantItem';
14
-import { participants } from './participants';
15 15
 import styles from './styles';
16 16
 
17 17
 export const MeetingParticipantList = () => {
18 18
     const dispatch = useDispatch();
19
-    const onInvite = useCallback(() => {
20
-        sendAnalytics(createToolbarEvent('invite'));
21
-        dispatch(doInvitePeople());
22
-    }, [ dispatch ]);
19
+    const onInvite = useCallback(() => dispatch(doInvitePeople()), [ dispatch ]);
20
+    const showInviteButton = useSelector(shouldRenderInviteButton);
21
+    const store = useStore();
22
+    const state = store.getState();
23
+    const participants = getParticipants(state);
23 24
     const { t } = useTranslation();
24 25
 
25 26
     return (
@@ -28,23 +29,28 @@ export const MeetingParticipantList = () => {
28 29
                 {t('participantsPane.headings.participantsList',
29 30
                     { count: participants.length })}
30 31
             </Text>
31
-            <Button
32
-                children = { t('participantsPane.actions.invite') }
33
-                /* eslint-disable-next-line react/jsx-no-bind */
34
-                icon = { () =>
35
-                    (<Icon
36
-                        size = { 24 }
37
-                        src = { IconInviteMore } />)
38
-                }
39
-                labelStyle = { styles.inviteLabel }
40
-                mode = 'contained'
41
-                onPress = { onInvite }
42
-                style = { styles.inviteButton } />
43
-            { participants.map(p => (
44
-                <MeetingParticipantItem
45
-                    key = { p.id }
46
-                    participant = { p } />)
47
-            )}
32
+            {
33
+                showInviteButton
34
+                && <Button
35
+                    children = { t('participantsPane.actions.invite') }
36
+                    /* eslint-disable-next-line react/jsx-no-bind */
37
+                    icon = { () =>
38
+                        (<Icon
39
+                            size = { 24 }
40
+                            src = { IconInviteMore } />)
41
+                    }
42
+                    labelStyle = { styles.inviteLabel }
43
+                    mode = 'contained'
44
+                    onPress = { onInvite }
45
+                    style = { styles.inviteButton } />
46
+            }
47
+            {
48
+                participants.map(p => (
49
+                    <MeetingParticipantItem
50
+                        key = { p.id }
51
+                        participant = { p } />)
52
+                )
53
+            }
48 54
         </View>
49 55
     );
50 56
 };

+ 7
- 4
react/features/participants-pane/components/native/ParticipantItem.js 查看文件

@@ -67,12 +67,12 @@ type Props = {
67 67
  * @returns {React$Element<any>}
68 68
  */
69 69
 function ParticipantItem({
70
-    audioMuteState = MediaState.None,
71 70
     children,
72 71
     isKnockingParticipant,
73 72
     name,
74 73
     onPress,
75 74
     participant: p,
75
+    audioMuteState = MediaState.None,
76 76
     videoMuteState = MediaState.None
77 77
 }: Props) {
78 78
 
@@ -96,8 +96,11 @@ function ParticipantItem({
96 96
                     { p.local ? <Text style = { styles.isLocal }>({t('chat.you')})</Text> : null }
97 97
                 </View>
98 98
                 {
99
-                    !isKnockingParticipant && <>
100
-                        {p.raisedHand && <RaisedHandIndicator />}
99
+                    !isKnockingParticipant
100
+                    && <>
101
+                        {
102
+                            p.raisedHand && <RaisedHandIndicator />
103
+                        }
101 104
                         <View style = { styles.participantStatesContainer }>
102 105
                             <View style = { styles.participantStateVideo }>{VideoStateIcons[videoMuteState]}</View>
103 106
                             <View>{AudioStateIcons[audioMuteState]}</View>
@@ -105,7 +108,7 @@ function ParticipantItem({
105 108
                     </>
106 109
                 }
107 110
             </TouchableOpacity>
108
-            { children }
111
+            { !p.local && children }
109 112
         </View>
110 113
     );
111 114
 }

+ 27
- 22
react/features/participants-pane/components/native/ParticipantsPane.js 查看文件

@@ -4,11 +4,12 @@ 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 } from 'react-redux';
7
+import { useDispatch, useSelector } 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 13
 import MuteEveryoneDialog
13 14
     from '../../../video-menu/components/native/MuteEveryoneDialog';
14 15
 
@@ -24,8 +25,9 @@ import styles from './styles';
24 25
  */
25 26
 export function ParticipantsPane() {
26 27
     const dispatch = useDispatch();
27
-    const openMoreMenu = useCallback(() => dispatch(openDialog(ContextMenuMore)));
28
+    const openMoreMenu = useCallback(() => dispatch(openDialog(ContextMenuMore)), [ dispatch ]);
28 29
     const closePane = useCallback(() => dispatch(hideDialog()), [ dispatch ]);
30
+    const isLocalModerator = useSelector(isLocalParticipantModerator);
29 31
     const muteAll = useCallback(() => dispatch(openDialog(MuteEveryoneDialog)),
30 32
         [ dispatch ]);
31 33
     const { t } = useTranslation();
@@ -51,26 +53,29 @@ export function ParticipantsPane() {
51 53
                 <LobbyParticipantList />
52 54
                 <MeetingParticipantList />
53 55
             </ScrollView>
54
-            <View style = { styles.footer }>
55
-                <Button
56
-                    children = { t('participantsPane.actions.muteAll') }
57
-                    contentStyle = { styles.muteAllContent }
58
-                    labelStyle = { styles.muteAllLabel }
59
-                    mode = 'contained'
60
-                    onPress = { muteAll }
61
-                    style = { styles.muteAllButton } />
62
-                <Button
63
-                    contentStyle = { styles.moreIcon }
64
-                    /* eslint-disable-next-line react/jsx-no-bind */
65
-                    icon = { () =>
66
-                        (<Icon
67
-                            size = { 24 }
68
-                            src = { IconHorizontalPoints } />)
69
-                    }
70
-                    mode = 'contained'
71
-                    onPress = { openMoreMenu }
72
-                    style = { styles.moreButton } />
73
-            </View>
56
+            {
57
+                isLocalModerator
58
+                && <View style = { styles.footer }>
59
+                    <Button
60
+                        children = { t('participantsPane.actions.muteAll') }
61
+                        contentStyle = { styles.muteAllContent }
62
+                        labelStyle = { styles.muteAllLabel }
63
+                        mode = 'contained'
64
+                        onPress = { muteAll }
65
+                        style = { styles.muteAllButton } />
66
+                    <Button
67
+                        contentStyle = { styles.moreIcon }
68
+                        /* eslint-disable-next-line react/jsx-no-bind */
69
+                        icon = { () =>
70
+                            (<Icon
71
+                                size = { 24 }
72
+                                src = { IconHorizontalPoints } />)
73
+                        }
74
+                        mode = 'contained'
75
+                        onPress = { openMoreMenu }
76
+                        style = { styles.moreButton } />
77
+                </View>
78
+            }
74 79
         </JitsiModal>
75 80
     );
76 81
 }

+ 5
- 0
react/features/participants-pane/components/native/ParticipantsPaneButton.js 查看文件

@@ -5,8 +5,12 @@ import type { Dispatch } from 'redux';
5 5
 import { openDialog } from '../../../base/dialog';
6 6
 import { translate } from '../../../base/i18n';
7 7
 import { IconParticipants } from '../../../base/icons';
8
+import { setActiveModalId } from '../../../base/modal';
8 9
 import { connect } from '../../../base/redux';
9 10
 import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
11
+import {
12
+    PARTICIPANTS_PANE_ID
13
+} from '../../../invite/constants';
10 14
 
11 15
 import { ParticipantsPane } from './';
12 16
 
@@ -35,6 +39,7 @@ class ParticipantsPaneButton extends AbstractButton<Props, *> {
35 39
      */
36 40
     _handleClick() {
37 41
         this.props.dispatch(openDialog(ParticipantsPane));
42
+        this.props.dispatch(setActiveModalId(PARTICIPANTS_PANE_ID));
38 43
     }
39 44
 }
40 45
 

+ 2
- 2
react/features/toolbox/components/native/OverflowMenuButton.js 查看文件

@@ -3,7 +3,7 @@
3 3
 import { openDialog } from '../../../base/dialog';
4 4
 import { getFeatureFlag, OVERFLOW_MENU_ENABLED } from '../../../base/flags';
5 5
 import { translate } from '../../../base/i18n';
6
-import { IconMenuThumb } from '../../../base/icons';
6
+import { IconHorizontalPoints } from '../../../base/icons';
7 7
 import { connect } from '../../../base/redux';
8 8
 import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
9 9
 
@@ -25,7 +25,7 @@ type Props = AbstractButtonProps & {
25 25
  */
26 26
 class OverflowMenuButton extends AbstractButton<Props, *> {
27 27
     accessibilityLabel = 'toolbar.accessibilityLabel.moreActions';
28
-    icon = IconMenuThumb;
28
+    icon = IconHorizontalPoints;
29 29
     label = 'toolbar.moreActions';
30 30
 
31 31
     /**

正在加载...
取消
保存