瀏覽代碼

feat(native-participants-pane) added showHeaderWithNavigation prop to JitsiModal and created close button

master
Calin Chitu 4 年之前
父節點
當前提交
6597bfc2aa

+ 19
- 3
react/features/base/modal/components/JitsiModal.js 查看文件

66
      */
66
      */
67
     position?: string,
67
     position?: string,
68
 
68
 
69
+    /**
70
+     * True if the header with navigation should be shown, false otherwise.
71
+     */
72
+    showHeaderWithNavigation: boolean,
73
+
69
     /**
74
     /**
70
      * Additional style to be appended to the View containing the content of the modal.
75
      * Additional style to be appended to the View containing the content of the modal.
71
      */
76
      */
98
      * @inheritdoc
103
      * @inheritdoc
99
      */
104
      */
100
     render() {
105
     render() {
101
-        const { _headerStyles, _show, _styles, children, footerComponent, headerProps, position, style } = this.props;
106
+        const {
107
+            _headerStyles,
108
+            _show,
109
+            _styles,
110
+            children,
111
+            footerComponent,
112
+            headerProps,
113
+            position,
114
+            showHeaderWithNavigation,
115
+            style
116
+        } = this.props;
102
 
117
 
103
         return (
118
         return (
104
             <SlidingView
119
             <SlidingView
117
                         _styles.page,
132
                         _styles.page,
118
                         style
133
                         style
119
                     ] }>
134
                     ] }>
120
-                    <HeaderWithNavigation
135
+                    {showHeaderWithNavigation
136
+                    && <HeaderWithNavigation
121
                         { ...headerProps }
137
                         { ...headerProps }
122
-                        onPressBack = { this._onRequestClose } />
138
+                        onPressBack = { this._onRequestClose } />}
123
                     <SafeAreaView style = { styles.safeArea }>
139
                     <SafeAreaView style = { styles.safeArea }>
124
                         { children }
140
                         { children }
125
                     </SafeAreaView>
141
                     </SafeAreaView>

+ 2
- 1
react/features/chat/components/native/Chat.js 查看文件

44
                     headerLabelKey: 'chat.title'
44
                     headerLabelKey: 'chat.title'
45
                 }}
45
                 }}
46
                 modalId = { CHAT_VIEW_MODAL_ID }
46
                 modalId = { CHAT_VIEW_MODAL_ID }
47
-                onClose = { this._onClose }>
47
+                onClose = { this._onClose }
48
+                showHeaderWithNavigation = { true }>
48
 
49
 
49
                 <MessageContainer messages = { this.props._messages } />
50
                 <MessageContainer messages = { this.props._messages } />
50
                 <MessageRecipient />
51
                 <MessageRecipient />

+ 1
- 0
react/features/etherpad/components/native/SharedDocument.js 查看文件

78
                     headerLabelKey: 'documentSharing.title'
78
                     headerLabelKey: 'documentSharing.title'
79
                 }}
79
                 }}
80
                 modalId = { SHARE_DOCUMENT_VIEW_ID }
80
                 modalId = { SHARE_DOCUMENT_VIEW_ID }
81
+                showHeaderWithNavigation = { true }
81
                 style = { styles.webView }>
82
                 style = { styles.webView }>
82
                 <WebView
83
                 <WebView
83
                     onError = { this._onError }
84
                     onError = { this._onError }

+ 2
- 1
react/features/help/components/HelpView.js 查看文件

33
                 headerProps = {{
33
                 headerProps = {{
34
                     headerLabelKey: 'helpView.header'
34
                     headerLabelKey: 'helpView.header'
35
                 }}
35
                 }}
36
-                modalId = { HELP_VIEW_MODAL_ID }>
36
+                modalId = { HELP_VIEW_MODAL_ID }
37
+                showHeaderWithNavigation = { true }>
37
                 <WebView source = {{ uri: this.props._url }} />
38
                 <WebView source = {{ uri: this.props._url }} />
38
             </JitsiModal>
39
             </JitsiModal>
39
         );
40
         );

+ 2
- 1
react/features/invite/components/add-people-dialog/native/AddPeopleDialog.js 查看文件

176
                     headerLabelKey: 'inviteDialog.header',
176
                     headerLabelKey: 'inviteDialog.header',
177
                     onPressForward: this._onInvite
177
                     onPressForward: this._onInvite
178
                 }}
178
                 }}
179
-                modalId = { ADD_PEOPLE_DIALOG_VIEW_ID }>
179
+                modalId = { ADD_PEOPLE_DIALOG_VIEW_ID }
180
+                showHeaderWithNavigation = { true }>
180
                 <View
181
                 <View
181
                     style = { styles.searchFieldWrapper }>
182
                     style = { styles.searchFieldWrapper }>
182
                     <View style = { styles.searchIconWrapper }>
183
                     <View style = { styles.searchIconWrapper }>

+ 2
- 1
react/features/invite/components/dial-in-summary/native/DialInSummary.js 查看文件

58
                     headerLabelKey: 'info.label'
58
                     headerLabelKey: 'info.label'
59
                 }}
59
                 }}
60
                 modalId = { DIAL_IN_SUMMARY_VIEW_ID }
60
                 modalId = { DIAL_IN_SUMMARY_VIEW_ID }
61
-                style = { styles.backDrop } >
61
+                showHeaderWithNavigation = { true }
62
+                style = { styles.backDrop }>
62
                 <WebView
63
                 <WebView
63
                     onError = { this._onError }
64
                     onError = { this._onError }
64
                     onShouldStartLoadWithRequest = { this._onNavigate }
65
                     onShouldStartLoadWithRequest = { this._onNavigate }

+ 21
- 9
react/features/participants-pane/components/native/ParticipantsPane.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
 import React, { useCallback } from 'react';
3
 import React, { useCallback } from 'react';
4
-import { Button, Text, withTheme } from 'react-native-paper';
4
+import { Button, withTheme } from 'react-native-paper';
5
 import { useDispatch } from 'react-redux';
5
 import { useDispatch } from 'react-redux';
6
 
6
 
7
 
7
 
8
 import { translate } from '../../../base/i18n';
8
 import { translate } from '../../../base/i18n';
9
+import { Icon, IconClose } from '../../../base/icons';
9
 import { JitsiModal } from '../../../base/modal';
10
 import { JitsiModal } from '../../../base/modal';
10
 import { close } from '../../actions';
11
 import { close } from '../../actions';
11
 
12
 
13
+import styles from './styles';
14
+
12
 /**
15
 /**
13
  * {@code ParticipantsPane}'s React {@code Component} prop types.
16
  * {@code ParticipantsPane}'s React {@code Component} prop types.
14
  */
17
  */
31
         () => dispatch(close()),
34
         () => dispatch(close()),
32
         [ dispatch ]);
35
         [ dispatch ]);
33
 
36
 
37
+    const { palette } = theme;
38
+
34
     return (
39
     return (
35
         <JitsiModal
40
         <JitsiModal
36
-            headerProps = {{
37
-                onPressBack: closePane()
38
-            }}>
39
-            {/* eslint-disable-next-line react/jsx-no-bind */}
40
-            <Button onPress = { closePane }> X</Button>
41
-            <Text>
42
-                OLE
43
-            </Text>
41
+            showHeaderWithNavigation = { false }
42
+            style = { styles.participantsPane }>
43
+            <Button
44
+                mode = 'contained'
45
+                onPress = { closePane }
46
+                style = { styles.closeButton }
47
+                theme = {{
48
+                    colors: {
49
+                        primary: palette.action02
50
+                    }
51
+                }}>
52
+                <Icon
53
+                    src = { IconClose }
54
+                    style = { styles.closeIcon } />
55
+            </Button>
44
         </JitsiModal>
56
         </JitsiModal>
45
     );
57
     );
46
 }
58
 }

+ 26
- 0
react/features/participants-pane/components/native/styles.js 查看文件

1
+import BaseTheme from '../../../base/ui/components/BaseTheme.native';
2
+
3
+/**
4
+ * The styles of the native components of the feature {@code participants}.
5
+ */
6
+export default {
7
+    participantsPane: {
8
+        backgroundColor: BaseTheme.palette.ui01,
9
+        padding: 16
10
+    },
11
+
12
+    closeButton: {
13
+        alignItems: 'center',
14
+        display: 'flex',
15
+        height: 48,
16
+        justifyContent: 'center',
17
+        marginLeft: 'auto'
18
+    },
19
+
20
+    closeIcon: {
21
+        display: 'flex',
22
+        flex: 1,
23
+        fontSize: 24,
24
+        justifyContent: 'center'
25
+    }
26
+};

+ 2
- 1
react/features/settings/components/native/SettingsView.js 查看文件

158
                     headerLabelKey: 'settingsView.header'
158
                     headerLabelKey: 'settingsView.header'
159
                 }}
159
                 }}
160
                 modalId = { SETTINGS_VIEW_ID }
160
                 modalId = { SETTINGS_VIEW_ID }
161
-                onClose = { this._onClose }>
161
+                onClose = { this._onClose }
162
+                showHeaderWithNavigation = { true }>
162
                 <ScrollView>
163
                 <ScrollView>
163
                     <FormSectionAccordion
164
                     <FormSectionAccordion
164
                         accordion = { false }
165
                         accordion = { false }

Loading…
取消
儲存