Browse Source

feat(native-participants-pane) removed button component, fixed icons inside paper button component and reverted actions.js files

master
Calin Chitu 4 years ago
parent
commit
cb0b68f840

+ 0
- 21
react/features/lobby/actions.any.js View File

@@ -23,24 +23,3 @@ export function toggleLobbyMode(enabled: boolean) {
23 23
         }
24 24
     };
25 25
 }
26
-
27
-/**
28
- * Approves (lets in) or rejects a knocking participant.
29
- *
30
- * @param {string} id - The id of the knocking participant.
31
- * @param {boolean} approved - True if the participant is approved, false otherwise.
32
- * @returns {Function}
33
- */
34
-export function setKnockingParticipantApproval(id: string, approved: boolean) {
35
-    return async (dispatch: Dispatch<any>, getState: Function) => {
36
-        const conference = getCurrentConference(getState);
37
-
38
-        if (conference) {
39
-            if (approved) {
40
-                conference.lobbyApproveAccess(id);
41
-            } else {
42
-                conference.lobbyDenyAccess(id);
43
-            }
44
-        }
45
-    };
46
-}

+ 0
- 1
react/features/lobby/actions.native.js View File

@@ -5,7 +5,6 @@ import { openDialog } from '../base/dialog';
5 5
 import { DisableLobbyModeDialog, EnableLobbyModeDialog } from './components/native';
6 6
 
7 7
 export * from './actions.web';
8
-export * from './actions.any';
9 8
 
10 9
 /**
11 10
  * Action to show the dialog to disable lobby mode.

+ 0
- 3
react/features/participants-pane/actions.native.js View File

@@ -1,3 +0,0 @@
1
-// @flow
2
-
3
-export * from './actions.any';

+ 0
- 3
react/features/participants-pane/actions.web.js View File

@@ -1,3 +0,0 @@
1
-// @flow
2
-
3
-export * from './actions.any';

+ 0
- 115
react/features/participants-pane/components/native/Button.js View File

@@ -1,115 +0,0 @@
1
-// @flow
2
-
3
-import React from 'react';
4
-import { View } from 'react-native';
5
-import { Button as PaperButton } from 'react-native-paper';
6
-
7
-import { Icon } from '../../../base/icons';
8
-
9
-let buttonContent;
10
-
11
-/**
12
- * The type of the React {@code Component} props of {@link Button}
13
- */
14
-type Props = {
15
-
16
-    /**
17
-     * Button content.
18
-     */
19
-    content?: string,
20
-
21
-    /**
22
-     * Is the button icon type?
23
-     */
24
-    iconButton?: boolean,
25
-
26
-    /**
27
-     * Style for the icon
28
-     */
29
-    iconStyle?: Object,
30
-
31
-    /**
32
-     * Size of the icon.
33
-     */
34
-    iconSize?: number,
35
-
36
-    /**
37
-     * Icon component source.
38
-     */
39
-    iconSrc?: Object,
40
-
41
-    /**
42
-     * Button mode.
43
-     */
44
-    mode?: string,
45
-
46
-    /**
47
-     * Style of button's inner content.
48
-     */
49
-    contentStyle?: Object,
50
-
51
-    /**
52
-     * The action to be performed when the button is pressed.
53
-     */
54
-    onPress?: Function,
55
-
56
-    /**
57
-     * An external style object passed to the component.
58
-     */
59
-    style?: Object,
60
-
61
-    /**
62
-     * Theme to be applied.
63
-     */
64
-    theme?: Object
65
-};
66
-
67
-/**
68
- * Close button component.
69
- *
70
- * @returns {React$Element<any>}
71
- */
72
-function Button({
73
-    iconButton,
74
-    iconStyle,
75
-    iconSize,
76
-    iconSrc,
77
-    content,
78
-    contentStyle,
79
-    mode,
80
-    onPress,
81
-    style,
82
-    theme
83
-}: Props) {
84
-
85
-    if (iconButton) {
86
-        buttonContent
87
-            = (<View
88
-                /* eslint-disable-next-line react-native/no-inline-styles */
89
-                style = {{
90
-                    height: 0,
91
-                    width: 0
92
-                }}>
93
-                <Icon
94
-                    size = { iconSize }
95
-                    src = { iconSrc }
96
-                    style = { iconStyle } />
97
-            </View>);
98
-
99
-    } else {
100
-        buttonContent = content;
101
-    }
102
-
103
-    return (
104
-        <PaperButton
105
-            contentStyle = { contentStyle }
106
-            mode = { mode }
107
-            onPress = { onPress }
108
-            style = { style }
109
-            theme = { theme }>
110
-            { buttonContent }
111
-        </PaperButton>
112
-    );
113
-}
114
-
115
-export default Button;

+ 33
- 34
react/features/participants-pane/components/native/ParticipantsPane.js View File

@@ -3,16 +3,14 @@
3 3
 import React, { useCallback } from 'react';
4 4
 import { useTranslation } from 'react-i18next';
5 5
 import { View } from 'react-native';
6
-import { withTheme } from 'react-native-paper';
6
+import { Button, withTheme } from 'react-native-paper';
7 7
 import { useDispatch, useSelector } from 'react-redux';
8 8
 
9
-import { IconClose, IconHorizontalPoints } from '../../../base/icons';
9
+import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
10 10
 import { JitsiModal } from '../../../base/modal';
11 11
 import { isLocalParticipantModerator } from '../../../base/participants';
12 12
 import { close } from '../../actions.any';
13 13
 
14
-import Button from './Button';
15
-import { LobbyParticipantList } from './LobbyParticipantList';
16 14
 import styles from './styles';
17 15
 
18 16
 
@@ -47,11 +45,13 @@ function ParticipantsPane({ theme }: Props) {
47 45
             style = { styles.participantsPane }>
48 46
             <View style = { styles.header }>
49 47
                 <Button
50
-                    contentStyle = { styles.muteAllContent }
51
-                    iconButton = { true }
52
-                    iconSize = { 16 }
53
-                    iconSrc = { IconClose }
54
-                    iconStyle = { styles.closeIcon }
48
+                    contentStyle = { styles.closeIcon }
49
+                    /* eslint-disable-next-line react/jsx-no-bind */
50
+                    icon = { () =>
51
+                        (<Icon
52
+                            size = { 16 }
53
+                            src = { IconClose } />)
54
+                    }
55 55
                     mode = 'contained'
56 56
                     onPress = { closePane }
57 57
                     style = { styles.closeButton }
@@ -61,31 +61,30 @@ function ParticipantsPane({ theme }: Props) {
61 61
                         }
62 62
                     }} />
63 63
             </View>
64
-            <LobbyParticipantList />
65
-            {
66
-                isLocalModerator
67
-                && <View style = { styles.footer }>
68
-                    <Button
69
-                        content = { t('participantsPane.actions.muteAll') }
70
-                        contentStyle = { styles.muteAllContent }
71
-                        onPress = { closePane }
72
-                        style = { styles.muteAllButton } />
73
-                    <Button
74
-                        contentStyle = { styles.muteAllContent }
75
-                        iconButton = { true }
76
-                        iconSize = { 16 }
77
-                        iconSrc = { IconHorizontalPoints }
78
-                        iconStyle = { styles.moreIcon }
79
-                        mode = 'contained'
80
-                        onPress = { closePane }
81
-                        style = { styles.moreButton }
82
-                        theme = {{
83
-                            colors: {
84
-                                primary: palette.action02
85
-                            }
86
-                        }} />
87
-                </View>
88
-            }
64
+            <View style = { styles.footer }>
65
+                <Button
66
+                    contentStyle = { styles.muteAllContent }
67
+                    onPress = { closePane }
68
+                    style = { styles.muteAllButton } >
69
+                    { t('participantsPane.actions.muteAll') }
70
+                </Button>
71
+                <Button
72
+                    contentStyle = { styles.moreIcon }
73
+                    /* eslint-disable-next-line react/jsx-no-bind */
74
+                    icon = { () =>
75
+                        (<Icon
76
+                            size = { 16 }
77
+                            src = { IconHorizontalPoints } />)
78
+                    }
79
+                    mode = 'contained'
80
+                    onPress = { closePane }
81
+                    style = { styles.moreButton }
82
+                    theme = {{
83
+                        colors: {
84
+                            primary: palette.action02
85
+                        }
86
+                    }} />
87
+            </View>
89 88
         </JitsiModal>
90 89
     );
91 90
 }

+ 0
- 10
react/features/participants-pane/components/native/styles.js View File

@@ -147,16 +147,6 @@ export default {
147 147
         ...buttonContent
148 148
     },
149 149
 
150
-    moreButtonPaper: {
151
-        ...smallButton,
152
-        height: 48
153
-    },
154
-
155
-    moreIconPaper: {
156
-        alignItems: 'center',
157
-        flexDirection: 'row-reverse'
158
-    },
159
-
160 150
     muteAllButton: {
161 151
         ...button,
162 152
         paddingBottom: 12,

Loading…
Cancel
Save