瀏覽代碼

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

master
Calin Chitu 3 年之前
父節點
當前提交
24550777c6

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

@@ -50,6 +50,11 @@ type Props = {
50 50
      */
51 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 59
      * The ID of the modal that is being rendered. This is used to show/hide the modal.
55 60
      */
@@ -66,11 +71,6 @@ type Props = {
66 71
      */
67 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 75
      * Additional style to be appended to the View containing the content of the modal.
76 76
      */
@@ -83,7 +83,8 @@ type Props = {
83 83
  */
84 84
 class JitsiModal extends PureComponent<Props> {
85 85
     static defaultProps = {
86
-        position: 'bottom'
86
+        position: 'bottom',
87
+        hideHeaderWithNavigation: false
87 88
     };
88 89
 
89 90
     /**
@@ -111,7 +112,7 @@ class JitsiModal extends PureComponent<Props> {
111 112
             footerComponent,
112 113
             headerProps,
113 114
             position,
114
-            showHeaderWithNavigation,
115
+            hideHeaderWithNavigation,
115 116
             style
116 117
         } = this.props;
117 118
 
@@ -132,10 +133,10 @@ class JitsiModal extends PureComponent<Props> {
132 133
                         _styles.page,
133 134
                         style
134 135
                     ] }>
135
-                    {showHeaderWithNavigation
136
-                    && <HeaderWithNavigation
136
+                    <HeaderWithNavigation
137 137
                         { ...headerProps }
138
-                        onPressBack = { this._onRequestClose } />}
138
+                        hideHeaderWithNavigation = { hideHeaderWithNavigation }
139
+                        onPressBack = { this._onRequestClose } />
139 140
                     <SafeAreaView style = { styles.safeArea }>
140 141
                         { children }
141 142
                     </SafeAreaView>

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

@@ -27,6 +27,11 @@ type Props = {
27 27
      */
28 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 36
      * Callback to be invoked on pressing the back button.
32 37
      */
@@ -48,17 +53,22 @@ class HeaderWithNavigation extends Component<Props> {
48 53
      * @inheritdoc
49 54
      */
50 55
     render() {
51
-        const { onPressBack, onPressForward } = this.props;
56
+        const { hideHeaderWithNavigation, onPressBack, onPressForward } = this.props;
52 57
 
53 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,8 +44,7 @@ class Chat extends AbstractChat<Props> {
44 44
                     headerLabelKey: 'chat.title'
45 45
                 }}
46 46
                 modalId = { CHAT_VIEW_MODAL_ID }
47
-                onClose = { this._onClose }
48
-                showHeaderWithNavigation = { true }>
47
+                onClose = { this._onClose }>
49 48
 
50 49
                 <MessageContainer messages = { this.props._messages } />
51 50
                 <MessageRecipient />

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

@@ -78,7 +78,6 @@ class SharedDocument extends PureComponent<Props> {
78 78
                     headerLabelKey: 'documentSharing.title'
79 79
                 }}
80 80
                 modalId = { SHARE_DOCUMENT_VIEW_ID }
81
-                showHeaderWithNavigation = { true }
82 81
                 style = { styles.webView }>
83 82
                 <WebView
84 83
                     onError = { this._onError }

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

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

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

@@ -176,8 +176,7 @@ class AddPeopleDialog extends AbstractAddPeopleDialog<Props, State> {
176 176
                     headerLabelKey: 'inviteDialog.header',
177 177
                     onPressForward: this._onInvite
178 178
                 }}
179
-                modalId = { ADD_PEOPLE_DIALOG_VIEW_ID }
180
-                showHeaderWithNavigation = { true }>
179
+                modalId = { ADD_PEOPLE_DIALOG_VIEW_ID }>
181 180
                 <View
182 181
                     style = { styles.searchFieldWrapper }>
183 182
                     <View style = { styles.searchIconWrapper }>

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

@@ -58,7 +58,6 @@ class DialInSummary extends Component<Props> {
58 58
                     headerLabelKey: 'info.label'
59 59
                 }}
60 60
                 modalId = { DIAL_IN_SUMMARY_VIEW_ID }
61
-                showHeaderWithNavigation = { true }
62 61
                 style = { styles.backDrop }>
63 62
                 <WebView
64 63
                     onError = { this._onError }

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

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

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

@@ -158,8 +158,7 @@ class SettingsView extends AbstractSettingsView<Props, State> {
158 158
                     headerLabelKey: 'settingsView.header'
159 159
                 }}
160 160
                 modalId = { SETTINGS_VIEW_ID }
161
-                onClose = { this._onClose }
162
-                showHeaderWithNavigation = { true }>
161
+                onClose = { this._onClose }>
163 162
                 <ScrollView>
164 163
                     <FormSectionAccordion
165 164
                         accordion = { false }

Loading…
取消
儲存