Browse Source

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 years ago
parent
commit
d8ad39ed3f

+ 7
- 1
css/_welcome_page.scss View File

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

+ 12
- 5
react/features/app/functions.web.js View File

@@ -31,9 +31,9 @@ const _INTERCEPT_COMPONENT_RULES = [
31 31
 
32 32
     /**
33 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 38
      * @param {Object} state - The redux state of the app.
39 39
      * @returns {UnsupportedMobileBrowser|void} If the rule is satisfied then
@@ -42,8 +42,15 @@ const _INTERCEPT_COMPONENT_RULES = [
42 42
     // eslint-disable-next-line no-unused-vars
43 43
     state => {
44 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 54
             const mobileAppPromo
48 55
                 = typeof interfaceConfig === 'object'
49 56
                     && interfaceConfig.MOBILE_APP_PROMO;

+ 14
- 0
react/features/welcome/components/WelcomePage.web.js View File

@@ -10,6 +10,7 @@ import { initAnalytics } from '../../analytics';
10 10
 import { translate } from '../../base/i18n';
11 11
 import { isAnalyticsEnabled } from '../../base/lib-jitsi-meet';
12 12
 import { Watermarks } from '../../base/react';
13
+import { HideNotificationBarStyle } from '../../unsupported-browser';
13 14
 
14 15
 import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
15 16
 
@@ -69,6 +70,8 @@ class WelcomePage extends AbstractWelcomePage {
69 70
      * @returns {void}
70 71
      */
71 72
     componentDidMount() {
73
+        document.body.classList.add('welcome-page');
74
+
72 75
         // FIXME: This is not the best place for this logic. Ideally we should
73 76
         // use features/base/lib-jitsi-meet#initLib() action for this use case.
74 77
         // But currently lib-jitsi-meet#initLib()'s logic works for mobile only
@@ -90,6 +93,16 @@ class WelcomePage extends AbstractWelcomePage {
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 107
      * Implements React's {@link Component#render()}.
95 108
      *
@@ -150,6 +163,7 @@ class WelcomePage extends AbstractWelcomePage {
150 163
                             ref = { this._setAdditionalContentRef } />
151 164
                         : null }
152 165
                 </div>
166
+                <HideNotificationBarStyle />
153 167
             </AtlasKitThemeProvider>
154 168
         );
155 169
     }

Loading…
Cancel
Save