Quellcode durchsuchen

feat(native-participants-pane) first lobbyparticipantlist steps

master
Calin Chitu vor 4 Jahren
Ursprung
Commit
f984faef3f

+ 3
- 2
react/features/participants-pane/components/native/LobbyParticipantItem.js Datei anzeigen

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

+ 11
- 19
react/features/participants-pane/components/native/LobbyParticipantList.js Datei anzeigen

@@ -2,35 +2,27 @@
2 2
 
3 3
 import React from 'react';
4 4
 import { useTranslation } from 'react-i18next';
5
-import { View } from 'react-native';
6 5
 import { Text } from 'react-native-paper';
7
-import { useSelector } from 'react-redux';
8
-
9
-import { getLobbyState } from '../../../lobby/functions';
10 6
 
11 7
 import { LobbyParticipantItem } from './LobbyParticipantItem';
12 8
 import { participants } from './participants';
9
+import styles from './styles';
13 10
 
14 11
 export const LobbyParticipantList = () => {
15
-    const {
16
-        lobbyEnabled
17
-    } = useSelector(getLobbyState);
18 12
     const { t } = useTranslation();
19 13
 
20
-    if (!lobbyEnabled || !participants.length) {
21
-        return null;
22
-    }
23
-
24 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 Datei anzeigen

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

+ 6
- 2
react/features/participants-pane/components/native/ParticipantsPane.js Datei anzeigen

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

+ 2
- 0
react/features/participants-pane/components/native/participants.js Datei anzeigen

@@ -35,6 +35,7 @@ export const participants = [
35 35
         name: 'me',
36 36
         pinned: false,
37 37
         presence: undefined,
38
+        raisedHand: true,
38 39
         role: 'participant',
39 40
         startWithAudioMuted: true,
40 41
         startWithVideoMuted: false
@@ -95,6 +96,7 @@ export const participants = [
95 96
         name: 'Carlin',
96 97
         pinned: false,
97 98
         presence: undefined,
99
+        raisedHand: true,
98 100
         role: 'participant',
99 101
         startWithAudioMuted: true,
100 102
         startWithVideoMuted: false

+ 25
- 34
react/features/participants-pane/components/native/styles.js Datei anzeigen

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

Laden…
Abbrechen
Speichern