浏览代码

feat(native-participants-pane) simplified props for hiding header with navigation

master
Calin Chitu 4 年前
父节点
当前提交
24550777c6

+ 11
- 10
react/features/base/modal/components/JitsiModal.js 查看文件

50
      */
50
      */
51
     headerProps: Object,
51
     headerProps: Object,
52
 
52
 
53
+    /**
54
+     * True if the header with navigation should be hidden, false otherwise.
55
+     */
56
+    hideHeaderWithNavigation?: boolean,
57
+
53
     /**
58
     /**
54
      * The ID of the modal that is being rendered. This is used to show/hide the modal.
59
      * The ID of the modal that is being rendered. This is used to show/hide the modal.
55
      */
60
      */
66
      */
71
      */
67
     position?: string,
72
     position?: string,
68
 
73
 
69
-    /**
70
-     * True if the header with navigation should be shown, false otherwise.
71
-     */
72
-    showHeaderWithNavigation: boolean,
73
-
74
     /**
74
     /**
75
      * 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.
76
      */
76
      */
83
  */
83
  */
84
 class JitsiModal extends PureComponent<Props> {
84
 class JitsiModal extends PureComponent<Props> {
85
     static defaultProps = {
85
     static defaultProps = {
86
-        position: 'bottom'
86
+        position: 'bottom',
87
+        hideHeaderWithNavigation: false
87
     };
88
     };
88
 
89
 
89
     /**
90
     /**
111
             footerComponent,
112
             footerComponent,
112
             headerProps,
113
             headerProps,
113
             position,
114
             position,
114
-            showHeaderWithNavigation,
115
+            hideHeaderWithNavigation,
115
             style
116
             style
116
         } = this.props;
117
         } = this.props;
117
 
118
 
132
                         _styles.page,
133
                         _styles.page,
133
                         style
134
                         style
134
                     ] }>
135
                     ] }>
135
-                    {showHeaderWithNavigation
136
-                    && <HeaderWithNavigation
136
+                    <HeaderWithNavigation
137
                         { ...headerProps }
137
                         { ...headerProps }
138
-                        onPressBack = { this._onRequestClose } />}
138
+                        hideHeaderWithNavigation = { hideHeaderWithNavigation }
139
+                        onPressBack = { this._onRequestClose } />
139
                     <SafeAreaView style = { styles.safeArea }>
140
                     <SafeAreaView style = { styles.safeArea }>
140
                         { children }
141
                         { children }
141
                     </SafeAreaView>
142
                     </SafeAreaView>

+ 19
- 9
react/features/base/react/components/native/HeaderWithNavigation.js 查看文件

27
      */
27
      */
28
     headerLabelKey: ?string,
28
     headerLabelKey: ?string,
29
 
29
 
30
+    /**
31
+     * True if the header with navigation should be hidden, false otherwise.
32
+     */
33
+    hideHeaderWithNavigation?: boolean,
34
+
30
     /**
35
     /**
31
      * Callback to be invoked on pressing the back button.
36
      * Callback to be invoked on pressing the back button.
32
      */
37
      */
48
      * @inheritdoc
53
      * @inheritdoc
49
      */
54
      */
50
     render() {
55
     render() {
51
-        const { onPressBack, onPressForward } = this.props;
56
+        const { hideHeaderWithNavigation, onPressBack, onPressForward } = this.props;
52
 
57
 
53
         return (
58
         return (
54
-            <Header>
55
-                { onPressBack && <BackButton onPress = { onPressBack } /> }
56
-                <HeaderLabel labelKey = { this.props.headerLabelKey } />
57
-                { onPressForward && <ForwardButton
58
-                    disabled = { this.props.forwardDisabled }
59
-                    labelKey = { this.props.forwardLabelKey }
60
-                    onPress = { onPressForward } /> }
61
-            </Header>
59
+            <>
60
+                {
61
+                    !hideHeaderWithNavigation
62
+                    && <Header>
63
+                        { onPressBack && <BackButton onPress = { onPressBack } /> }
64
+                        <HeaderLabel labelKey = { this.props.headerLabelKey } />
65
+                        { onPressForward && <ForwardButton
66
+                            disabled = { this.props.forwardDisabled }
67
+                            labelKey = { this.props.forwardLabelKey }
68
+                            onPress = { onPressForward } /> }
69
+                    </Header>
70
+                }
71
+            </>
62
         );
72
         );
63
     }
73
     }
64
 }
74
 }

+ 1
- 2
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 }
48
-                showHeaderWithNavigation = { true }>
47
+                onClose = { this._onClose }>
49
 
48
 
50
                 <MessageContainer messages = { this.props._messages } />
49
                 <MessageContainer messages = { this.props._messages } />
51
                 <MessageRecipient />
50
                 <MessageRecipient />

+ 0
- 1
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 }
82
                 style = { styles.webView }>
81
                 style = { styles.webView }>
83
                 <WebView
82
                 <WebView
84
                     onError = { this._onError }
83
                     onError = { this._onError }

+ 1
- 2
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 }
37
-                showHeaderWithNavigation = { true }>
36
+                modalId = { HELP_VIEW_MODAL_ID }>
38
                 <WebView source = {{ uri: this.props._url }} />
37
                 <WebView source = {{ uri: this.props._url }} />
39
             </JitsiModal>
38
             </JitsiModal>
40
         );
39
         );

+ 1
- 2
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 }
180
-                showHeaderWithNavigation = { true }>
179
+                modalId = { ADD_PEOPLE_DIALOG_VIEW_ID }>
181
                 <View
180
                 <View
182
                     style = { styles.searchFieldWrapper }>
181
                     style = { styles.searchFieldWrapper }>
183
                     <View style = { styles.searchIconWrapper }>
182
                     <View style = { styles.searchIconWrapper }>

+ 0
- 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
-                showHeaderWithNavigation = { true }
62
                 style = { styles.backDrop }>
61
                 style = { styles.backDrop }>
63
                 <WebView
62
                 <WebView
64
                     onError = { this._onError }
63
                     onError = { this._onError }

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

32
 
32
 
33
     return (
33
     return (
34
         <JitsiModal
34
         <JitsiModal
35
-            showHeaderWithNavigation = { false }
35
+            hideHeaderWithNavigation = { true }
36
             style = { styles.participantsPane }>
36
             style = { styles.participantsPane }>
37
             <View style = { styles.header }>
37
             <View style = { styles.header }>
38
                 <Button
38
                 <Button

+ 1
- 2
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 }
162
-                showHeaderWithNavigation = { true }>
161
+                onClose = { this._onClose }>
163
                 <ScrollView>
162
                 <ScrollView>
164
                     <FormSectionAccordion
163
                     <FormSectionAccordion
165
                         accordion = { false }
164
                         accordion = { false }

正在加载...
取消
保存