Ver código fonte

feat(native-participants-pane) first lobbyparticipantlist steps

master
Calin Chitu 4 anos atrás
pai
commit
f984faef3f

+ 3
- 2
react/features/participants-pane/components/native/LobbyParticipantItem.js Ver arquivo

31
             participant = { p }
31
             participant = { p }
32
             videoMuteState = { MediaState.None }>
32
             videoMuteState = { MediaState.None }>
33
             <Button
33
             <Button
34
-                onClick = { reject }
34
+                mode = 'contained'
35
+                onPress = { reject }
35
                 style = { styles.participantActionButton }>
36
                 style = { styles.participantActionButton }>
36
                 {t('lobby.reject')}
37
                 {t('lobby.reject')}
37
             </Button>
38
             </Button>
38
             <Button
39
             <Button
39
-                onClick = { admit }
40
+                onPress = { admit }
40
                 style = { styles.participantActionButton }>
41
                 style = { styles.participantActionButton }>
41
                 {t('lobby.admit')}
42
                 {t('lobby.admit')}
42
             </Button>
43
             </Button>

+ 11
- 19
react/features/participants-pane/components/native/LobbyParticipantList.js Ver arquivo

2
 
2
 
3
 import React from 'react';
3
 import React from 'react';
4
 import { useTranslation } from 'react-i18next';
4
 import { useTranslation } from 'react-i18next';
5
-import { View } from 'react-native';
6
 import { Text } from 'react-native-paper';
5
 import { Text } from 'react-native-paper';
7
-import { useSelector } from 'react-redux';
8
-
9
-import { getLobbyState } from '../../../lobby/functions';
10
 
6
 
11
 import { LobbyParticipantItem } from './LobbyParticipantItem';
7
 import { LobbyParticipantItem } from './LobbyParticipantItem';
12
 import { participants } from './participants';
8
 import { participants } from './participants';
9
+import styles from './styles';
13
 
10
 
14
 export const LobbyParticipantList = () => {
11
 export const LobbyParticipantList = () => {
15
-    const {
16
-        lobbyEnabled
17
-    } = useSelector(getLobbyState);
18
     const { t } = useTranslation();
12
     const { t } = useTranslation();
19
 
13
 
20
-    if (!lobbyEnabled || !participants.length) {
21
-        return null;
22
-    }
23
-
24
     return (
14
     return (
25
         <>
15
         <>
26
-            <Text>{t('participantsPane.headings.lobby', { count: participants.length })}</Text>
27
-            <View>
28
-                {participants.map(p => (
29
-                    <LobbyParticipantItem
30
-                        key = { p.id }
31
-                        participant = { p } />)
32
-                )}
33
-            </View>
16
+            {/* eslint-disable-next-line max-len */}
17
+            <Text style = { styles.participantName }>
18
+                {t('participantsPane.headings.lobby',
19
+                    { count: participants.length })}
20
+            </Text>
21
+            { participants.map(p => (
22
+                <LobbyParticipantItem
23
+                    key = { p.id }
24
+                    participant = { p } />)
25
+            )}
34
         </>
26
         </>
35
     );
27
     );
36
 };
28
 };

+ 10
- 2
react/features/participants-pane/components/native/ParticipantItem.js Ver arquivo

1
 // @flow
1
 // @flow
2
 
2
 
3
 import React from 'react';
3
 import React from 'react';
4
+import type { Node } from 'react';
4
 import { useTranslation } from 'react-i18next';
5
 import { useTranslation } from 'react-i18next';
5
 import { View } from 'react-native';
6
 import { View } from 'react-native';
6
 import { Text } from 'react-native-paper';
7
 import { Text } from 'react-native-paper';
24
      */
25
      */
25
     audioMuteState: MediaState,
26
     audioMuteState: MediaState,
26
 
27
 
28
+    /**
29
+     * React children
30
+     */
31
+    children: Node,
32
+
27
     /**
33
     /**
28
      * Callback for when the mouse leaves this component
34
      * Callback for when the mouse leaves this component
29
      */
35
      */
46
  * @returns {React$Element<any>}
52
  * @returns {React$Element<any>}
47
  */
53
  */
48
 function ParticipantItem({
54
 function ParticipantItem({
55
+    children,
49
     audioMuteState = MediaState.None,
56
     audioMuteState = MediaState.None,
50
     videoMuteState = MediaState.None,
57
     videoMuteState = MediaState.None,
51
     participant: p
58
     participant: p
57
         <View style = { styles.participantContainer } >
64
         <View style = { styles.participantContainer } >
58
             <Avatar
65
             <Avatar
59
                 className = 'participant-avatar'
66
                 className = 'participant-avatar'
60
-                participant = { p.id }
67
+                participantId = { p.id }
61
                 size = { 32 } />
68
                 size = { 32 } />
62
             <View style = { styles.participantContent }>
69
             <View style = { styles.participantContent }>
63
                 <View style = { styles.participantNameContainer }>
70
                 <View style = { styles.participantNameContainer }>
64
                     <Text style = { styles.participantName }>
71
                     <Text style = { styles.participantName }>
65
                         { name }
72
                         { name }
66
                     </Text>
73
                     </Text>
67
-                    { p.local ? <Text>({t('chat.you')})</Text> : null }
74
+                    { p.local ? <Text style = { styles.isLocal }>({t('chat.you')})</Text> : null }
68
                 </View>
75
                 </View>
76
+                { !p.local && children }
69
                 <View style = { styles.participantStates } >
77
                 <View style = { styles.participantStates } >
70
                     {p.raisedHand && <RaisedHandIndicator />}
78
                     {p.raisedHand && <RaisedHandIndicator />}
71
                     {VideoStateIcons[videoMuteState]}
79
                     {VideoStateIcons[videoMuteState]}

+ 6
- 2
react/features/participants-pane/components/native/ParticipantsPane.js Ver arquivo

10
 import { JitsiModal } from '../../../base/modal';
10
 import { JitsiModal } from '../../../base/modal';
11
 import { close } from '../../actions.any';
11
 import { close } from '../../actions.any';
12
 
12
 
13
+import { LobbyParticipantList } from './LobbyParticipantList';
13
 import styles from './styles';
14
 import styles from './styles';
14
 
15
 
15
 
16
 
47
                     /* eslint-disable-next-line react/jsx-no-bind */
48
                     /* eslint-disable-next-line react/jsx-no-bind */
48
                     icon = { () =>
49
                     icon = { () =>
49
                         (<Icon
50
                         (<Icon
50
-                            size = { 16 }
51
+                            size = { 24 }
51
                             src = { IconClose } />)
52
                             src = { IconClose } />)
52
                     }
53
                     }
53
                     mode = 'contained'
54
                     mode = 'contained'
59
                         }
60
                         }
60
                     }} />
61
                     }} />
61
             </View>
62
             </View>
63
+            <LobbyParticipantList />
62
             <View style = { styles.footer }>
64
             <View style = { styles.footer }>
63
                 <Button
65
                 <Button
66
+                    color = { palette.text01 }
67
+                    compact = { true }
64
                     contentStyle = { styles.muteAllContent }
68
                     contentStyle = { styles.muteAllContent }
65
                     onPress = { closePane }
69
                     onPress = { closePane }
66
                     style = { styles.muteAllButton } >
70
                     style = { styles.muteAllButton } >
71
                     /* eslint-disable-next-line react/jsx-no-bind */
75
                     /* eslint-disable-next-line react/jsx-no-bind */
72
                     icon = { () =>
76
                     icon = { () =>
73
                         (<Icon
77
                         (<Icon
74
-                            size = { 16 }
78
+                            size = { 24 }
75
                             src = { IconHorizontalPoints } />)
79
                             src = { IconHorizontalPoints } />)
76
                     }
80
                     }
77
                     mode = 'contained'
81
                     mode = 'contained'

+ 2
- 0
react/features/participants-pane/components/native/participants.js Ver arquivo

35
         name: 'me',
35
         name: 'me',
36
         pinned: false,
36
         pinned: false,
37
         presence: undefined,
37
         presence: undefined,
38
+        raisedHand: true,
38
         role: 'participant',
39
         role: 'participant',
39
         startWithAudioMuted: true,
40
         startWithAudioMuted: true,
40
         startWithVideoMuted: false
41
         startWithVideoMuted: false
95
         name: 'Carlin',
96
         name: 'Carlin',
96
         pinned: false,
97
         pinned: false,
97
         presence: undefined,
98
         presence: undefined,
99
+        raisedHand: true,
98
         role: 'participant',
100
         role: 'participant',
99
         startWithAudioMuted: true,
101
         startWithAudioMuted: true,
100
         startWithVideoMuted: false
102
         startWithVideoMuted: false

+ 25
- 34
react/features/participants-pane/components/native/styles.js Ver arquivo

1
 import BaseTheme from '../../../base/ui/components/BaseTheme.native';
1
 import BaseTheme from '../../../base/ui/components/BaseTheme.native';
2
 
2
 
3
-/**
4
- * The style for content.
5
- */
6
-const flexContent = {
7
-    alignItems: 'center',
8
-    color: BaseTheme.palette.icon01,
9
-    display: 'flex',
10
-    flex: 1
11
-};
12
-
13
 /**
3
 /**
14
  * The style of the participants pane buttons.
4
  * The style of the participants pane buttons.
15
  */
5
  */
17
     alignItems: 'center',
7
     alignItems: 'center',
18
     display: 'flex',
8
     display: 'flex',
19
     flexDirection: 'row',
9
     flexDirection: 'row',
20
-    height: 64,
21
-    justifyContent: 'center',
22
-    paddingRight: 8,
10
+    height: 72,
11
+    paddingRight: 16,
23
     width: '100%'
12
     width: '100%'
24
 };
13
 };
25
 
14
 
32
     borderRadius: BaseTheme.shape.borderRadius,
21
     borderRadius: BaseTheme.shape.borderRadius,
33
     display: 'flex',
22
     display: 'flex',
34
     height: 48,
23
     height: 48,
24
+    justifyContent: 'center',
35
     marginLeft: 'auto'
25
     marginLeft: 'auto'
36
 };
26
 };
37
 
27
 
48
  */
38
  */
49
 const buttonContent = {
39
 const buttonContent = {
50
     ...BaseTheme.typography.labelButtonLarge,
40
     ...BaseTheme.typography.labelButtonLarge,
51
-    ...flexContent,
41
+    color: BaseTheme.palette.text01,
52
     justifyContent: 'center'
42
     justifyContent: 'center'
53
 };
43
 };
54
 
44
 
70
 
60
 
71
     participantContainer: {
61
     participantContainer: {
72
         alignItems: 'center',
62
         alignItems: 'center',
73
-        color: BaseTheme.palette.text01,
74
         display: 'flex',
63
         display: 'flex',
64
+        flexDirection: 'row',
75
         fontSize: 13,
65
         fontSize: 13,
76
         height: 64,
66
         height: 64,
67
+        justifyContent: 'center',
77
         margin: BaseTheme.spacing[4],
68
         margin: BaseTheme.spacing[4],
78
-        position: 'relative',
79
-        width: 375
69
+        paddingLeft: 8,
70
+        paddingRight: 8
80
     },
71
     },
81
 
72
 
82
     participantContent: {
73
     participantContent: {
83
-        ...flexContent,
74
+        backgroundColor: 'green',
84
         boxShadow: BaseTheme.shape.boxShadow,
75
         boxShadow: BaseTheme.shape.boxShadow,
85
-        height: '100%',
86
         overflow: 'hidden',
76
         overflow: 'hidden',
87
-        paddingRight: BaseTheme.spacing[4]
77
+        paddingRight: BaseTheme.spacing[4],
78
+        width: '100%'
88
     },
79
     },
89
 
80
 
90
     participantNameContainer: {
81
     participantNameContainer: {
91
         display: 'flex',
82
         display: 'flex',
92
         flex: 1,
83
         flex: 1,
84
+        flexDirection: 'row',
93
         marginRight: BaseTheme.spacing[3],
85
         marginRight: BaseTheme.spacing[3],
94
         overflow: 'hidden'
86
         overflow: 'hidden'
95
     },
87
     },
96
 
88
 
97
     participantName: {
89
     participantName: {
98
         overflow: 'hidden',
90
         overflow: 'hidden',
99
-        textOverflow: 'ellipsis',
100
-        whiteSpace: 'nowrap'
91
+        color: BaseTheme.palette.text01
92
+    },
93
+
94
+    isLocal: {
95
+        color: BaseTheme.palette.text01
101
     },
96
     },
102
 
97
 
103
     participantsPane: {
98
     participantsPane: {
105
     },
100
     },
106
 
101
 
107
     participantStates: {
102
     participantStates: {
108
-        display: 'flex',
109
-        justifyContent: 'flex-end'
103
+        alignItems: 'flex-end',
104
+        display: 'flex'
110
     },
105
     },
111
 
106
 
112
     raisedHandIndicator: {
107
     raisedHandIndicator: {
121
     },
116
     },
122
 
117
 
123
     header: {
118
     header: {
124
-        ...container,
125
-        backgroundColor: 'red'
119
+        ...container
126
     },
120
     },
127
 
121
 
128
     footer: {
122
     footer: {
129
         ...container,
123
         ...container,
130
-        backgroundColor: 'green',
131
         marginTop: 'auto'
124
         marginTop: 'auto'
132
     },
125
     },
133
 
126
 
136
     },
129
     },
137
 
130
 
138
     closeIcon: {
131
     closeIcon: {
139
-        ...buttonContent
132
+        ...buttonContent,
133
+        left: 8
140
     },
134
     },
141
 
135
 
142
     moreButton: {
136
     moreButton: {
144
     },
138
     },
145
 
139
 
146
     moreIcon: {
140
     moreIcon: {
147
-        ...buttonContent
141
+        ...buttonContent,
142
+        left: 8
148
     },
143
     },
149
 
144
 
150
     muteAllButton: {
145
     muteAllButton: {
151
         ...button,
146
         ...button,
152
-        paddingBottom: 12,
153
-        paddingLeft: 16,
154
-        paddingRight: 16,
155
-        paddingTop: 12,
156
-        width: 94
147
+        left: 80
157
     },
148
     },
158
 
149
 
159
     muteAllContent: {
150
     muteAllContent: {

Carregando…
Cancelar
Salvar