Bläddra i källkod

feat(native-participants-pane) fixed lint errors

master
Calin Chitu 4 år sedan
förälder
incheckning
bdd6638067

+ 12
- 12
react/features/participants-pane/components/native/Button.js Visa fil

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

1
 // @flow
1
 // @flow
2
 
2
 
3
 import React from 'react';
3
 import React from 'react';
4
+import { useTranslation } from 'react-i18next';
4
 import { View } from 'react-native';
5
 import { View } from 'react-native';
6
+import { Text } from 'react-native-paper';
5
 import { useSelector } from 'react-redux';
7
 import { useSelector } from 'react-redux';
6
 
8
 
7
-// import { getLobbyState } from '../../../lobby/functions';
9
+import { getLobbyState } from '../../../lobby/functions';
8
 
10
 
9
 import { LobbyParticipantItem } from './LobbyParticipantItem';
11
 import { LobbyParticipantItem } from './LobbyParticipantItem';
10
 import { participants } from './participants';
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 Visa fil

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 Visa fil

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 Visa fil

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

+ 1
- 1
react/features/participants-pane/components/native/ParticipantsPane.js Visa fil

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

Laddar…
Avbryt
Spara