Переглянути джерело

fix(welcome-page): modify styling for narrow screens (#2724)

* fix(welcome-page): modify styling for narrow screens

* squash: fix autoscrolling on mobile safari
master
virtuacoplenny 7 роки тому
джерело
коміт
d8ad39ed3f

+ 7
- 1
css/_welcome_page.scss Переглянути файл

1
+body.welcome-page {
2
+    background: inherit;
3
+    overflow: auto;
4
+}
5
+
1
 .welcome {
6
 .welcome {
2
     font-family: $welcomePageFontFamily;
7
     font-family: $welcomePageFontFamily;
3
     height: 100%;
8
     height: 100%;
4
-    overflow: auto;
5
     position: relative;
9
     position: relative;
6
 
10
 
7
     .header {
11
     .header {
19
             justify-content: space-around;
23
             justify-content: space-around;
20
             margin-top: 120px;
24
             margin-top: 120px;
21
             margin-bottom: 20px;
25
             margin-bottom: 20px;
26
+            max-width: calc(100% - 40px);
22
             min-height: 286px;
27
             min-height: 286px;
23
             width: 645px;
28
             width: 645px;
24
         }
29
         }
50
             align-items: center;
55
             align-items: center;
51
             display: flex;
56
             display: flex;
52
             margin-bottom: 20px;
57
             margin-bottom: 20px;
58
+            max-width: calc(100% - 40px);
53
             position: relative;
59
             position: relative;
54
             z-index: 2;
60
             z-index: 2;
55
 
61
 

+ 12
- 5
react/features/app/functions.web.js Переглянути файл

31
 
31
 
32
     /**
32
     /**
33
      * This rule describes case when user opens application using mobile
33
      * This rule describes case when user opens application using mobile
34
-     * browser. In order to promote the app, we choose to suggest the mobile
35
-     * app even if the browser supports the app (e.g. Google Chrome with
36
-     * WebRTC support on Android).
34
+     * browser and is attempting to join a conference. In order to promote the
35
+     * app, we choose to suggest the mobile app even if the browser supports the
36
+     * app (e.g. Google Chrome with WebRTC support on Android).
37
      *
37
      *
38
      * @param {Object} state - The redux state of the app.
38
      * @param {Object} state - The redux state of the app.
39
      * @returns {UnsupportedMobileBrowser|void} If the rule is satisfied then
39
      * @returns {UnsupportedMobileBrowser|void} If the rule is satisfied then
42
     // eslint-disable-next-line no-unused-vars
42
     // eslint-disable-next-line no-unused-vars
43
     state => {
43
     state => {
44
         const OS = Platform.OS;
44
         const OS = Platform.OS;
45
-
46
-        if (OS === 'android' || OS === 'ios') {
45
+        const { room } = state['features/base/conference'];
46
+        const isUsingMobileBrowser = OS === 'android' || OS === 'ios';
47
+
48
+        /**
49
+         * Checking for presence of a room is done so that interception only
50
+         * occurs when trying to enter a meeting but pages outside of meeting,
51
+         * like WelcomePage, can still display.
52
+         */
53
+        if (room && isUsingMobileBrowser) {
47
             const mobileAppPromo
54
             const mobileAppPromo
48
                 = typeof interfaceConfig === 'object'
55
                 = typeof interfaceConfig === 'object'
49
                     && interfaceConfig.MOBILE_APP_PROMO;
56
                     && interfaceConfig.MOBILE_APP_PROMO;

+ 14
- 0
react/features/welcome/components/WelcomePage.web.js Переглянути файл

10
 import { translate } from '../../base/i18n';
10
 import { translate } from '../../base/i18n';
11
 import { isAnalyticsEnabled } from '../../base/lib-jitsi-meet';
11
 import { isAnalyticsEnabled } from '../../base/lib-jitsi-meet';
12
 import { Watermarks } from '../../base/react';
12
 import { Watermarks } from '../../base/react';
13
+import { HideNotificationBarStyle } from '../../unsupported-browser';
13
 
14
 
14
 import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
15
 import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
15
 
16
 
69
      * @returns {void}
70
      * @returns {void}
70
      */
71
      */
71
     componentDidMount() {
72
     componentDidMount() {
73
+        document.body.classList.add('welcome-page');
74
+
72
         // FIXME: This is not the best place for this logic. Ideally we should
75
         // FIXME: This is not the best place for this logic. Ideally we should
73
         // use features/base/lib-jitsi-meet#initLib() action for this use case.
76
         // use features/base/lib-jitsi-meet#initLib() action for this use case.
74
         // But currently lib-jitsi-meet#initLib()'s logic works for mobile only
77
         // But currently lib-jitsi-meet#initLib()'s logic works for mobile only
90
         }
93
         }
91
     }
94
     }
92
 
95
 
96
+    /**
97
+     * Removes the classname used for custom styling of the welcome page.
98
+     *
99
+     * @inheritdoc
100
+     * @returns {void}
101
+     */
102
+    componentWillUnmount() {
103
+        document.body.classList.remove('welcome-page');
104
+    }
105
+
93
     /**
106
     /**
94
      * Implements React's {@link Component#render()}.
107
      * Implements React's {@link Component#render()}.
95
      *
108
      *
150
                             ref = { this._setAdditionalContentRef } />
163
                             ref = { this._setAdditionalContentRef } />
151
                         : null }
164
                         : null }
152
                 </div>
165
                 </div>
166
+                <HideNotificationBarStyle />
153
             </AtlasKitThemeProvider>
167
             </AtlasKitThemeProvider>
154
         );
168
         );
155
     }
169
     }

Завантаження…
Відмінити
Зберегти