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
 
2
 
3
 import React, { useCallback } from 'react';
3
 import React, { useCallback } from 'react';
4
 import { useTranslation } from 'react-i18next';
4
 import { useTranslation } from 'react-i18next';
5
+import { View } from 'react-native';
5
 import { Button } from 'react-native-paper';
6
 import { Button } from 'react-native-paper';
6
 import { useDispatch } from 'react-redux';
7
 import { useDispatch } from 'react-redux';
7
 
8
 
30
             audioMuteState = { MediaState.Muted }
31
             audioMuteState = { MediaState.Muted }
31
             participant = { p }
32
             participant = { p }
32
             videoMuteState = { MediaState.ForceMuted }>
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
         </ParticipantItem>
50
         </ParticipantItem>
48
     );
51
     );
49
 };
52
 };

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

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

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

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

2
 
2
 
3
 import React, { useCallback } from 'react';
3
 import React, { useCallback } from 'react';
4
 import { useTranslation } from 'react-i18next';
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
 import { useDispatch } from 'react-redux';
7
 import { useDispatch } from 'react-redux';
8
 
8
 
9
 import { hideDialog } from '../../../base/dialog';
9
 import { hideDialog } from '../../../base/dialog';
11
 import { JitsiModal } from '../../../base/modal';
11
 import { JitsiModal } from '../../../base/modal';
12
 
12
 
13
 import { LobbyParticipantList } from './LobbyParticipantList';
13
 import { LobbyParticipantList } from './LobbyParticipantList';
14
+import { MeetingParticipantList } from './MeetingParticipantList';
14
 import styles from './styles';
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
  * Participant pane.
18
  * Participant pane.
30
  *
19
  *
31
  * @returns {React$Element<any>}
20
  * @returns {React$Element<any>}
32
  */
21
  */
33
-function ParticipantsPane({ theme }: Props) {
22
+export function ParticipantsPane() {
34
     const dispatch = useDispatch();
23
     const dispatch = useDispatch();
35
     const closePane = useCallback(
24
     const closePane = useCallback(
36
         () => dispatch(hideDialog()),
25
         () => dispatch(hideDialog()),
37
         [ dispatch ]);
26
         [ dispatch ]);
38
     const { t } = useTranslation();
27
     const { t } = useTranslation();
39
-    const { palette } = theme;
40
 
28
 
41
     return (
29
     return (
42
         <JitsiModal
30
         <JitsiModal
53
                     }
41
                     }
54
                     mode = 'contained'
42
                     mode = 'contained'
55
                     onPress = { closePane }
43
                     onPress = { closePane }
56
-                    style = { styles.closeButton }
57
-                    theme = {{
58
-                        colors: {
59
-                            primary: palette.action02
60
-                        }
61
-                    }} />
44
+                    style = { styles.closeButton } />
62
             </View>
45
             </View>
63
-            <LobbyParticipantList />
46
+            <ScrollView>
47
+                <LobbyParticipantList />
48
+                <MeetingParticipantList />
49
+            </ScrollView>
64
             <View style = { styles.footer }>
50
             <View style = { styles.footer }>
65
                 <Button
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
                 <Button
55
                 <Button
72
                     contentStyle = { styles.moreIcon }
56
                     contentStyle = { styles.moreIcon }
73
                     /* eslint-disable-next-line react/jsx-no-bind */
57
                     /* eslint-disable-next-line react/jsx-no-bind */
77
                             src = { IconHorizontalPoints } />)
61
                             src = { IconHorizontalPoints } />)
78
                     }
62
                     }
79
                     mode = 'contained'
63
                     mode = 'contained'
80
-                    style = { styles.moreButton }
81
-                    theme = {{
82
-                        colors: {
83
-                            primary: palette.action02
84
-                        }
85
-                    }} />
64
+                    style = { styles.moreButton } />
86
             </View>
65
             </View>
87
         </JitsiModal>
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
     flex: 1
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
  * The style of the participants pane buttons.
22
  * The style of the participants pane buttons.
34
  */
23
  */
65
  */
54
  */
66
 export default {
55
 export default {
67
 
56
 
68
-    participantActions: {
57
+    lobbyParticipantItem: {
58
+        flexDirection: 'row',
69
         position: 'absolute',
59
         position: 'absolute',
70
         right: 0,
60
         right: 0,
71
         zIndex: 1
61
         zIndex: 1
110
         height: 32
100
         height: 32
111
     },
101
     },
112
 
102
 
103
+    participantActionsButtonContent: {
104
+        alignItems: 'center',
105
+        display: 'flex',
106
+        height: 32
107
+    },
108
+
113
     participantActionsButtonText: {
109
     participantActionsButtonText: {
110
+        color: BaseTheme.palette.text01,
111
+        textTransform: 'capitalize'
114
     },
112
     },
115
 
113
 
116
     allParticipantActionsButton: {
114
     allParticipantActionsButton: {
134
         alignItems: 'center',
132
         alignItems: 'center',
135
         display: 'flex',
133
         display: 'flex',
136
         flexDirection: 'row',
134
         flexDirection: 'row',
137
-        flexWrap: 'wrap',
135
+        height: '100%',
138
         overflow: 'hidden',
136
         overflow: 'hidden',
139
         width: '100%'
137
         width: '100%'
140
     },
138
     },
144
         flexDirection: 'row',
142
         flexDirection: 'row',
145
         marginLeft: BaseTheme.spacing[2],
143
         marginLeft: BaseTheme.spacing[2],
146
         overflow: 'hidden',
144
         overflow: 'hidden',
147
-        width: 232
145
+        width: '63%'
148
     },
146
     },
149
 
147
 
150
     participantName: {
148
     participantName: {
162
 
160
 
163
     participantStatesContainer: {
161
     participantStatesContainer: {
164
         display: 'flex',
162
         display: 'flex',
165
-        flexDirection: 'row'
163
+        flexDirection: 'row',
164
+        marginLeft: 16
166
     },
165
     },
167
 
166
 
168
     participantStateAudio: {
167
     participantStateAudio: {
170
     },
169
     },
171
 
170
 
172
     participantStateVideo: {
171
     participantStateVideo: {
173
-        ...participantState
172
+        ...participantState,
173
+        marginRight: 8
174
     },
174
     },
175
 
175
 
176
     raisedHandIndicator: {
176
     raisedHandIndicator: {
187
     },
187
     },
188
     lobbyList: {
188
     lobbyList: {
189
         marginLeft: 16,
189
         marginLeft: 16,
190
-        marginRight: 16
190
+        marginRight: 16,
191
+        position: 'relative'
191
     },
192
     },
192
 
193
 
193
     lobbyListDetails: {
194
     lobbyListDetails: {
194
         alignItems: 'center',
195
         alignItems: 'center',
195
         display: 'flex',
196
         display: 'flex',
196
         flexDirection: 'row',
197
         flexDirection: 'row',
198
+        overflow: 'hidden',
199
+        paddingBottom: 16,
200
+        paddingTop: 16,
201
+        position: 'relative',
197
         width: '100%'
202
         width: '100%'
198
     },
203
     },
199
 
204
 
200
     lobbyListDescription: {
205
     lobbyListDescription: {
201
         color: BaseTheme.palette.text01,
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
     lobbyListActions: {
213
     lobbyListActions: {
207
-        flexDirection: 'row'
214
+        flexDirection: 'row',
215
+        left: 0
208
     },
216
     },
209
 
217
 
210
     header: {
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
     footer: {
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
     closeButton: {
244
     closeButton: {
229
         ...smallButton
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
     moreIcon: {
266
     moreIcon: {
233
         ...buttonContent,
267
         ...buttonContent,
234
         left: 8
268
         left: 8
239
         left: 80
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