Pārlūkot izejas kodu

feat(native-participants-pane) created meeting participant list

master
Calin Chitu 4 gadus atpakaļ
vecāks
revīzija
f49c05c666

+ 17
- 14
react/features/participants-pane/components/native/LobbyParticipantItem.js Parādīt failu

@@ -2,6 +2,7 @@
2 2
 
3 3
 import React, { useCallback } from 'react';
4 4
 import { useTranslation } from 'react-i18next';
5
+import { View } from 'react-native';
5 6
 import { Button } from 'react-native-paper';
6 7
 import { useDispatch } from 'react-redux';
7 8
 
@@ -30,20 +31,22 @@ export const LobbyParticipantItem = ({ participant: p }: Props) => {
30 31
             audioMuteState = { MediaState.Muted }
31 32
             participant = { p }
32 33
             videoMuteState = { MediaState.ForceMuted }>
33
-            <Button
34
-                labelStyle = { styles.participantActionsButtonText }
35
-                mode = 'contained'
36
-                onPress = { admit }
37
-                style = { styles.participantActionsButtonAdmit }>
38
-                {t('lobby.admit')}
39
-            </Button>
40
-            <Button
41
-                labelStyle = { styles.participantActionsButtonText }
42
-                mode = 'contained'
43
-                onPress = { reject }
44
-                style = { styles.participantActionsButtonReject }>
45
-                {t('lobby.reject')}
46
-            </Button>
34
+            <View style = { styles.lobbyParticipantItem }>
35
+                <Button
36
+                    children = { t('lobby.admit') }
37
+                    contentStyle = { styles.participantActionsButtonContent }
38
+                    labelStyle = { styles.participantActionsButtonText }
39
+                    mode = 'contained'
40
+                    onPress = { admit }
41
+                    style = { styles.participantActionsButtonAdmit } />
42
+                <Button
43
+                    children = { t('lobby.reject') }
44
+                    contentStyle = { styles.participantActionsButtonContent }
45
+                    labelStyle = { styles.participantActionsButtonText }
46
+                    mode = 'contained'
47
+                    onPress = { reject }
48
+                    style = { styles.participantActionsButtonReject } />
49
+            </View>
47 50
         </ParticipantItem>
48 51
     );
49 52
 };

+ 33
- 0
react/features/participants-pane/components/native/MeetingParticipantItem.js Parādīt failu

@@ -0,0 +1,33 @@
1
+// @flow
2
+
3
+import React from 'react';
4
+import { useSelector } from 'react-redux';
5
+
6
+import {
7
+    getIsParticipantAudioMuted,
8
+    getIsParticipantVideoMuted
9
+} from '../../../base/tracks';
10
+import { MediaState } from '../../constants';
11
+
12
+import ParticipantItem from './ParticipantItem';
13
+
14
+
15
+type Props = {
16
+
17
+    /**
18
+     * Participant reference
19
+     */
20
+    participant: Object
21
+};
22
+
23
+export const MeetingParticipantItem = ({ participant }: Props) => {
24
+    const isAudioMuted = useSelector(getIsParticipantAudioMuted(participant));
25
+    const isVideoMuted = useSelector(getIsParticipantVideoMuted(participant));
26
+
27
+    return (
28
+        <ParticipantItem
29
+            audioMuteState = { isAudioMuted ? MediaState.Muted : MediaState.Unmuted }
30
+            participant = { participant }
31
+            videoMuteState = { isVideoMuted ? MediaState.Muted : MediaState.Unmuted } />
32
+    );
33
+};

+ 41
- 0
react/features/participants-pane/components/native/MeetingParticipantList.js Parādīt failu

@@ -0,0 +1,41 @@
1
+// @flow
2
+
3
+import React from 'react';
4
+import { useTranslation } from 'react-i18next';
5
+import { Text, View } from 'react-native';
6
+import { Button } from 'react-native-paper';
7
+
8
+import { Icon, IconInviteMore } from '../../../base/icons';
9
+
10
+import { MeetingParticipantItem } from './MeetingParticipantItem';
11
+import { participants } from './participants';
12
+import styles from './styles';
13
+
14
+export const MeetingParticipantList = () => {
15
+    const { t } = useTranslation();
16
+
17
+    return (
18
+        <View style = { styles.lobbyList }>
19
+            <Text style = { styles.lobbyListDescription }>
20
+                {t('participantsPane.headings.participantsList',
21
+                    { count: participants.length })}
22
+            </Text>
23
+            <Button
24
+                children = { t('participantsPane.actions.invite') }
25
+                /* eslint-disable-next-line react/jsx-no-bind */
26
+                icon = { () =>
27
+                    (<Icon
28
+                        size = { 24 }
29
+                        src = { IconInviteMore } />)
30
+                }
31
+                labelStyle = { styles.inviteLabel }
32
+                mode = 'contained'
33
+                style = { styles.inviteButton } />
34
+            { participants.map(p => (
35
+                <MeetingParticipantItem
36
+                    key = { p.id }
37
+                    participant = { p } />)
38
+            )}
39
+        </View>
40
+    );
41
+};

+ 4
- 3
react/features/participants-pane/components/native/ParticipantItem.js Parādīt failu

@@ -3,7 +3,8 @@
3 3
 import React from 'react';
4 4
 import type { Node } from 'react';
5 5
 import { useTranslation } from 'react-i18next';
6
-import { Text, View } from 'react-native';
6
+import { View } from 'react-native';
7
+import { Text } from 'react-native-paper';
7 8
 import { useSelector } from 'react-redux';
8 9
 
9 10
 import { Avatar } from '../../../base/avatar';
@@ -35,7 +36,7 @@ type Props = {
35 36
     /**
36 37
      * React children
37 38
      */
38
-    children: Node,
39
+    children?: Node,
39 40
 
40 41
     /**
41 42
      * Callback for when the mouse leaves this component
@@ -86,7 +87,7 @@ function ParticipantItem({
86 87
                     <View style = { styles.participantStateAudio }>{AudioStateIcons[audioMuteState]}</View>
87 88
                 </View>
88 89
             </View>
89
-            { p.local ? <Text style = { styles.participantActions }> { children } </Text> : null }
90
+            { children }
90 91
         </View>
91 92
     );
92 93
 }

+ 14
- 35
react/features/participants-pane/components/native/ParticipantsPane.js Parādīt failu

@@ -2,8 +2,8 @@
2 2
 
3 3
 import React, { useCallback } from 'react';
4 4
 import { useTranslation } from 'react-i18next';
5
-import { View } from 'react-native';
6
-import { Button, withTheme } from 'react-native-paper';
5
+import { ScrollView, View } from 'react-native';
6
+import { Button } from 'react-native-paper';
7 7
 import { useDispatch } from 'react-redux';
8 8
 
9 9
 import { hideDialog } from '../../../base/dialog';
@@ -11,32 +11,20 @@ import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
11 11
 import { JitsiModal } from '../../../base/modal';
12 12
 
13 13
 import { LobbyParticipantList } from './LobbyParticipantList';
14
+import { MeetingParticipantList } from './MeetingParticipantList';
14 15
 import styles from './styles';
15 16
 
16
-
17
-/**
18
- * {@code ParticipantsPane}'s React {@code Component} prop types.
19
- */
20
-type Props = {
21
-
22
-    /**
23
-     * Theme used for styles.
24
-     */
25
-    theme: Object
26
-}
27
-
28 17
 /**
29 18
  * Participant pane.
30 19
  *
31 20
  * @returns {React$Element<any>}
32 21
  */
33
-function ParticipantsPane({ theme }: Props) {
22
+export function ParticipantsPane() {
34 23
     const dispatch = useDispatch();
35 24
     const closePane = useCallback(
36 25
         () => dispatch(hideDialog()),
37 26
         [ dispatch ]);
38 27
     const { t } = useTranslation();
39
-    const { palette } = theme;
40 28
 
41 29
     return (
42 30
         <JitsiModal
@@ -53,21 +41,17 @@ function ParticipantsPane({ theme }: Props) {
53 41
                     }
54 42
                     mode = 'contained'
55 43
                     onPress = { closePane }
56
-                    style = { styles.closeButton }
57
-                    theme = {{
58
-                        colors: {
59
-                            primary: palette.action02
60
-                        }
61
-                    }} />
44
+                    style = { styles.closeButton } />
62 45
             </View>
63
-            <LobbyParticipantList />
46
+            <ScrollView>
47
+                <LobbyParticipantList />
48
+                <MeetingParticipantList />
49
+            </ScrollView>
64 50
             <View style = { styles.footer }>
65 51
                 <Button
66
-                    color = { palette.text01 }
67
-                    contentStyle = { styles.muteAllContent }
68
-                    style = { styles.muteAllButton } >
69
-                    { t('participantsPane.actions.muteAll') }
70
-                </Button>
52
+                    children = { t('participantsPane.actions.muteAll') }
53
+                    labelStyle = { styles.muteAllLabel }
54
+                    style = { styles.muteAllButton } />
71 55
                 <Button
72 56
                     contentStyle = { styles.moreIcon }
73 57
                     /* eslint-disable-next-line react/jsx-no-bind */
@@ -77,16 +61,11 @@ function ParticipantsPane({ theme }: Props) {
77 61
                             src = { IconHorizontalPoints } />)
78 62
                     }
79 63
                     mode = 'contained'
80
-                    style = { styles.moreButton }
81
-                    theme = {{
82
-                        colors: {
83
-                            primary: palette.action02
84
-                        }
85
-                    }} />
64
+                    style = { styles.moreButton } />
86 65
             </View>
87 66
         </JitsiModal>
88 67
     );
89 68
 }
90 69
 
91 70
 
92
-export default withTheme(ParticipantsPane);
71
+export default ParticipantsPane;

+ 60
- 25
react/features/participants-pane/components/native/styles.js Parādīt failu

@@ -18,17 +18,6 @@ const flexContent = {
18 18
     flex: 1
19 19
 };
20 20
 
21
-/**
22
- * The style of the participants pane buttons.
23
- */
24
-const container = {
25
-    alignItems: 'center',
26
-    display: 'flex',
27
-    flexDirection: 'row',
28
-    paddingRight: 16,
29
-    width: '100%'
30
-};
31
-
32 21
 /**
33 22
  * The style of the participants pane buttons.
34 23
  */
@@ -65,7 +54,8 @@ const buttonContent = {
65 54
  */
66 55
 export default {
67 56
 
68
-    participantActions: {
57
+    lobbyParticipantItem: {
58
+        flexDirection: 'row',
69 59
         position: 'absolute',
70 60
         right: 0,
71 61
         zIndex: 1
@@ -110,7 +100,15 @@ export default {
110 100
         height: 32
111 101
     },
112 102
 
103
+    participantActionsButtonContent: {
104
+        alignItems: 'center',
105
+        display: 'flex',
106
+        height: 32
107
+    },
108
+
113 109
     participantActionsButtonText: {
110
+        color: BaseTheme.palette.text01,
111
+        textTransform: 'capitalize'
114 112
     },
115 113
 
116 114
     allParticipantActionsButton: {
@@ -134,7 +132,7 @@ export default {
134 132
         alignItems: 'center',
135 133
         display: 'flex',
136 134
         flexDirection: 'row',
137
-        flexWrap: 'wrap',
135
+        height: '100%',
138 136
         overflow: 'hidden',
139 137
         width: '100%'
140 138
     },
@@ -144,7 +142,7 @@ export default {
144 142
         flexDirection: 'row',
145 143
         marginLeft: BaseTheme.spacing[2],
146 144
         overflow: 'hidden',
147
-        width: 232
145
+        width: '63%'
148 146
     },
149 147
 
150 148
     participantName: {
@@ -162,7 +160,8 @@ export default {
162 160
 
163 161
     participantStatesContainer: {
164 162
         display: 'flex',
165
-        flexDirection: 'row'
163
+        flexDirection: 'row',
164
+        marginLeft: 16
166 165
     },
167 166
 
168 167
     participantStateAudio: {
@@ -170,7 +169,8 @@ export default {
170 169
     },
171 170
 
172 171
     participantStateVideo: {
173
-        ...participantState
172
+        ...participantState,
173
+        marginRight: 8
174 174
     },
175 175
 
176 176
     raisedHandIndicator: {
@@ -187,33 +187,58 @@ export default {
187 187
     },
188 188
     lobbyList: {
189 189
         marginLeft: 16,
190
-        marginRight: 16
190
+        marginRight: 16,
191
+        position: 'relative'
191 192
     },
192 193
 
193 194
     lobbyListDetails: {
194 195
         alignItems: 'center',
195 196
         display: 'flex',
196 197
         flexDirection: 'row',
198
+        overflow: 'hidden',
199
+        paddingBottom: 16,
200
+        paddingTop: 16,
201
+        position: 'relative',
197 202
         width: '100%'
198 203
     },
199 204
 
200 205
     lobbyListDescription: {
201 206
         color: BaseTheme.palette.text01,
202
-        overflow: 'hidden',
203
-        width: 188
207
+        paddingBottom: 8,
208
+        paddingTop: 8,
209
+        position: 'relative',
210
+        width: '55%'
204 211
     },
205 212
 
206 213
     lobbyListActions: {
207
-        flexDirection: 'row'
214
+        flexDirection: 'row',
215
+        left: 0
208 216
     },
209 217
 
210 218
     header: {
211
-        ...container
219
+        alignItems: 'center',
220
+        backgroundColor: BaseTheme.palette.ui01,
221
+        top: 0,
222
+        display: 'flex',
223
+        flexDirection: 'row',
224
+        height: 88,
225
+        paddingRight: 16,
226
+        position: 'absolute',
227
+        right: 0,
228
+        left: 0
212 229
     },
213 230
 
214 231
     footer: {
215
-        ...container,
216
-        marginTop: 'auto'
232
+        alignItems: 'center',
233
+        backgroundColor: BaseTheme.palette.ui01,
234
+        bottom: 0,
235
+        display: 'flex',
236
+        flexDirection: 'row',
237
+        height: 88,
238
+        paddingRight: 16,
239
+        position: 'absolute',
240
+        right: 0,
241
+        left: 0
217 242
     },
218 243
 
219 244
     closeButton: {
@@ -229,6 +254,15 @@ export default {
229 254
         ...smallButton
230 255
     },
231 256
 
257
+    inviteButton: {
258
+        backgroundColor: BaseTheme.palette.action01
259
+    },
260
+
261
+    inviteLabel: {
262
+        ...BaseTheme.typography.labelButtonLarge,
263
+        textTransform: 'capitalize'
264
+    },
265
+
232 266
     moreIcon: {
233 267
         ...buttonContent,
234 268
         left: 8
@@ -239,7 +273,8 @@ export default {
239 273
         left: 80
240 274
     },
241 275
 
242
-    muteAllContent: {
243
-        ...buttonContent
276
+    muteAllLabel: {
277
+        color: BaseTheme.palette.text01,
278
+        textTransform: 'capitalize'
244 279
     }
245 280
 };

Notiek ielāde…
Atcelt
Saglabāt