Kaynağa Gözat

Move DialogContainer to BaseApp to have dialogs on the welcome screen too

master
Bettenbuk Zoltan 7 yıl önce
ebeveyn
işleme
126e2d6e14

+ 12
- 0
react/features/app/components/App.native.js Dosyayı Görüntüle

@@ -5,6 +5,7 @@ import { Linking } from 'react-native';
5 5
 
6 6
 import '../../analytics';
7 7
 import '../../authentication';
8
+import { DialogContainer } from '../../base/dialog';
8 9
 import '../../base/jwt';
9 10
 import { Platform } from '../../base/react';
10 11
 import {
@@ -180,6 +181,17 @@ export class App extends AbstractApp {
180 181
     _onLinkingURL({ url }) {
181 182
         super._openURL(url);
182 183
     }
184
+
185
+    /**
186
+     * Renders the platform specific dialog container.
187
+     *
188
+     * @returns {React$Element}
189
+     */
190
+    _renderDialogContainer() {
191
+        return (
192
+            <DialogContainer />
193
+        );
194
+    }
183 195
 }
184 196
 
185 197
 /**

+ 14
- 0
react/features/app/components/App.web.js Dosyayı Görüntüle

@@ -3,6 +3,7 @@
3 3
 import { AtlasKitThemeProvider } from '@atlaskit/theme';
4 4
 import React from 'react';
5 5
 
6
+import { DialogContainer } from '../../base/dialog';
6 7
 import '../../base/responsive-ui';
7 8
 import '../../chat';
8 9
 import '../../room-lock';
@@ -39,4 +40,17 @@ export class App extends AbstractApp {
39 40
             </AtlasKitThemeProvider>
40 41
         );
41 42
     }
43
+
44
+    /**
45
+     * Renders the platform specific dialog container.
46
+     *
47
+     * @returns {React$Element}
48
+     */
49
+    _renderDialogContainer() {
50
+        return (
51
+            <AtlasKitThemeProvider mode = 'dark'>
52
+                <DialogContainer />
53
+            </AtlasKitThemeProvider>
54
+        );
55
+    }
42 56
 }

+ 8
- 0
react/features/base/app/components/BaseApp.js Dosyayı Görüntüle

@@ -127,6 +127,7 @@ export default class BaseApp extends Component<*, State> {
127 127
                             { this._createMainElement(component) }
128 128
                             <SoundCollection />
129 129
                             { this._createExtraElement() }
130
+                            { this._renderDialogContainer() }
130 131
                         </Fragment>
131 132
                     </Provider>
132 133
                 </I18nextProvider>
@@ -235,4 +236,11 @@ export default class BaseApp extends Component<*, State> {
235 236
             this.setState({ route }, resolve);
236 237
         });
237 238
     }
239
+
240
+    /**
241
+     * Renders the platform specific dialog container.
242
+     *
243
+     * @returns {React$Element}
244
+     */
245
+    _renderDialogContainer: () => React$Element<*>
238 246
 }

+ 16
- 5
react/features/base/dialog/components/DialogContainer.js Dosyayı Görüntüle

@@ -22,7 +22,12 @@ export class DialogContainer extends Component {
22 22
         /**
23 23
          * The props to pass to the component that will be rendered.
24 24
          */
25
-        _componentProps: PropTypes.object
25
+        _componentProps: PropTypes.object,
26
+
27
+        /**
28
+         * True if the UI is in a compact state where we don't show dialogs.
29
+         */
30
+        _reducedUI: PropTypes.bool
26 31
     };
27 32
 
28 33
     /**
@@ -32,10 +37,13 @@ export class DialogContainer extends Component {
32 37
      * @returns {ReactElement}
33 38
      */
34 39
     render() {
35
-        const { _component: component } = this.props;
40
+        const {
41
+            _component: component,
42
+            _reducedUI: reducedUI
43
+        } = this.props;
36 44
 
37 45
         return (
38
-            component
46
+            component && !reducedUI
39 47
                 ? React.createElement(component, this.props._componentProps)
40 48
                 : null);
41 49
     }
@@ -49,15 +57,18 @@ export class DialogContainer extends Component {
49 57
  * @private
50 58
  * @returns {{
51 59
  *     _component: React.Component,
52
- *     _componentProps: Object
60
+ *     _componentProps: Object,
61
+ *     _reducedUI: boolean
53 62
  * }}
54 63
  */
55 64
 function _mapStateToProps(state) {
56 65
     const stateFeaturesBaseDialog = state['features/base/dialog'];
66
+    const { reducedUI } = state['features/base/responsive-ui'];
57 67
 
58 68
     return {
59 69
         _component: stateFeaturesBaseDialog.component,
60
-        _componentProps: stateFeaturesBaseDialog.componentProps
70
+        _componentProps: stateFeaturesBaseDialog.componentProps,
71
+        _reducedUI: reducedUI
61 72
     };
62 73
 }
63 74
 

+ 1
- 6
react/features/conference/components/Conference.native.js Dosyayı Görüntüle

@@ -8,7 +8,6 @@ import { connect as reactReduxConnect } from 'react-redux';
8 8
 
9 9
 import { appNavigate } from '../../app';
10 10
 import { connect, disconnect } from '../../base/connection';
11
-import { DialogContainer } from '../../base/dialog';
12 11
 import { getParticipantCount } from '../../base/participants';
13 12
 import { Container, LoadingIndicator, TintedView } from '../../base/react';
14 13
 import {
@@ -315,11 +314,7 @@ class Conference extends Component<Props> {
315 314
                     this._renderConferenceNotification()
316 315
                 }
317 316
 
318
-                {/*
319
-                  * The dialogs are in the topmost stacking layers.
320
-                  */
321
-                    this.props._reducedUI || <DialogContainer />
322
-                }
317
+                <NotificationsContainer />
323 318
             </Container>
324 319
         );
325 320
     }

+ 0
- 2
react/features/conference/components/Conference.web.js Dosyayı Görüntüle

@@ -8,7 +8,6 @@ import VideoLayout from '../../../../modules/UI/videolayout/VideoLayout';
8 8
 
9 9
 import { obtainConfig } from '../../base/config';
10 10
 import { connect, disconnect } from '../../base/connection';
11
-import { DialogContainer } from '../../base/dialog';
12 11
 import { translate } from '../../base/i18n';
13 12
 import { Filmstrip } from '../../filmstrip';
14 13
 import { CalleeInfoContainer } from '../../invite';
@@ -226,7 +225,6 @@ class Conference extends Component<Props> {
226 225
                 { filmstripOnly || <Toolbox /> }
227 226
                 { filmstripOnly || <SidePanel /> }
228 227
 
229
-                <DialogContainer />
230 228
                 <NotificationsContainer />
231 229
 
232 230
                 <CalleeInfoContainer />

+ 0
- 4
react/features/welcome/components/WelcomePage.web.js Dosyayı Görüntüle

@@ -7,7 +7,6 @@ import { AtlasKitThemeProvider } from '@atlaskit/theme';
7 7
 import React from 'react';
8 8
 import { connect } from 'react-redux';
9 9
 
10
-import { DialogContainer } from '../../base/dialog';
11 10
 import { translate } from '../../base/i18n';
12 11
 import { Platform, Watermarks } from '../../base/react';
13 12
 import { CalendarList } from '../../calendar-sync';
@@ -168,9 +167,6 @@ class WelcomePage extends AbstractWelcomePage {
168 167
                             ref = { this._setAdditionalContentRef } />
169 168
                         : null }
170 169
                 </div>
171
-                <AtlasKitThemeProvider mode = 'dark'>
172
-                    <DialogContainer />
173
-                </AtlasKitThemeProvider>
174 170
             </AtlasKitThemeProvider>
175 171
         );
176 172
     }

Loading…
İptal
Kaydet