Bladeren bron

feat(native-participants-pane) fixed lint errors

master
Calin Chitu 4 jaren geleden
bovenliggende
commit
bdd6638067

+ 12
- 12
react/features/participants-pane/components/native/Button.js Bestand weergeven

@@ -13,35 +13,35 @@ let buttonContent;
13 13
  */
14 14
 type Props = {
15 15
 
16
+    /**
17
+     * Button content.
18
+     */
19
+    content?: string,
20
+
16 21
     /**
17 22
      * Is the button icon type?
18 23
      */
19
-    iconButton: boolean,
24
+    iconButton?: boolean,
20 25
 
21 26
     /**
22 27
      * Style for the icon
23 28
      */
24
-    iconStyle: Object,
29
+    iconStyle?: Object,
25 30
 
26 31
     /**
27 32
      * Size of the icon.
28 33
      */
29
-    iconSize: number,
34
+    iconSize?: number,
30 35
 
31 36
     /**
32 37
      * Icon component source.
33 38
      */
34 39
     iconSrc?: Object,
35 40
 
36
-    /**
37
-     * Button content.
38
-     */
39
-    content: string,
40
-
41 41
     /**
42 42
      * Button mode.
43 43
      */
44
-    mode: string,
44
+    mode?: string,
45 45
 
46 46
     /**
47 47
      * Style of button's inner content.
@@ -51,17 +51,17 @@ type Props = {
51 51
     /**
52 52
      * The action to be performed when the button is pressed.
53 53
      */
54
-    onPress: Function,
54
+    onPress?: Function,
55 55
 
56 56
     /**
57 57
      * An external style object passed to the component.
58 58
      */
59
-    style: Object,
59
+    style?: Object,
60 60
 
61 61
     /**
62 62
      * Theme to be applied.
63 63
      */
64
-    theme: Object
64
+    theme?: Object
65 65
 };
66 66
 
67 67
 /**

+ 26
- 2
react/features/participants-pane/components/native/LobbyParticipantList.js Bestand weergeven

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

+ 0
- 19
react/features/participants-pane/components/native/MeetingParticipantItem.js Bestand weergeven

@@ -1,19 +0,0 @@
1
-// @flow
2
-
3
-import React from 'react';
4
-
5
-import ParticipantItem from './ParticipantItem';
6
-
7
-
8
-type Props = {
9
-
10
-    /**
11
-     * Participant reference
12
-     */
13
-    participant: Object
14
-};
15
-
16
-export const MeetingParticipantItem = ({ participant: p }: Props) => (
17
-    <ParticipantItem
18
-        participant = { p } />
19
-);

+ 0
- 36
react/features/participants-pane/components/native/MeetingParticipantList.js Bestand weergeven

@@ -1,36 +0,0 @@
1
-// @flow
2
-
3
-import React from 'react';
4
-import { useTranslation } from 'react-i18next';
5
-import { View } from 'react-native';
6
-import { Text } from 'react-native-paper';
7
-import { useSelector } from 'react-redux';
8
-
9
-import { getParticipants } from '../../../base/participants';
10
-
11
-import { MeetingParticipantItem } from './MeetingParticipantItem';
12
-import styles from './styles';
13
-
14
-
15
-export const MeetingParticipantList = () => {
16
-    const participants = useSelector(getParticipants);
17
-    const { t } = useTranslation();
18
-
19
-    return (
20
-        <View style = { styles.lobbyListContainer }>
21
-            <Text>
22
-                {
23
-                    t('participantsPane.headings.participantsList',
24
-                    { count: participants.length }
25
-                    )
26
-                }
27
-            </Text>
28
-            {
29
-                participants.map(p => (
30
-                    <MeetingParticipantItem
31
-                        key = { p.id }
32
-                        participant = { p } />)
33
-                )}
34
-        </View>
35
-    );
36
-};

+ 0
- 6
react/features/participants-pane/components/native/ParticipantItem.js Bestand weergeven

@@ -9,7 +9,6 @@ import { useSelector } from 'react-redux';
9 9
 import { Avatar } from '../../../base/avatar';
10 10
 import { getParticipantDisplayNameWithId } from '../../../base/participants';
11 11
 import {
12
-    ActionTrigger,
13 12
     AudioStateIcons,
14 13
     MediaState,
15 14
     VideoStateIcons
@@ -20,11 +19,6 @@ import styles from './styles';
20 19
 
21 20
 type Props = {
22 21
 
23
-    /**
24
-     * Type of trigger for the participant actions
25
-     */
26
-    actionsTrigger: ActionTrigger,
27
-
28 22
     /**
29 23
      * Media state for audio
30 24
      */

+ 1
- 1
react/features/participants-pane/components/native/ParticipantsPane.js Bestand weergeven

@@ -9,7 +9,7 @@ import { useDispatch, useSelector } from 'react-redux';
9 9
 import { IconClose, IconHorizontalPoints } from '../../../base/icons';
10 10
 import { JitsiModal } from '../../../base/modal';
11 11
 import { isLocalParticipantModerator } from '../../../base/participants';
12
-import { close } from '../../actions.native';
12
+import { close } from '../../actions.any';
13 13
 
14 14
 import Button from './Button';
15 15
 import { LobbyParticipantList } from './LobbyParticipantList';

Laden…
Annuleren
Opslaan