瀏覽代碼

Enable flow for written code

j8
Ilya Daynatovich 8 年之前
父節點
當前提交
905212b109

+ 6
- 1
css/_variables.scss 查看文件

@@ -129,8 +129,13 @@ $linkFontColor: #489afe;
129 129
 $linkHoverFontColor: #287ade;
130 130
 
131 131
 /**
132
- * Landing
132
+ * Unsupported browser
133 133
  */
134 134
 $primaryUnsupportedBrowserButtonBgColor: #17a0db;
135 135
 $unsupportedBrowserButtonBgColor: #ff9a00;
136 136
 $unsupportedBrowserTextColor: #4a4a4a;
137
+$unsupportedBrowserTextSmallFontSize: 17px;
138
+$unsupportedBrowserTitleColor: #fff;
139
+$unsupportedBrowserTitleFontSize: 24px;
140
+$unsupportedDesktopBrowserTextColor: rgba(255, 255, 255, 0.7);
141
+$unsupportedDesktopBrowserTextFontSize: 21px;

+ 1
- 1
css/unsupported-browser/_main.scss 查看文件

@@ -1,3 +1,3 @@
1 1
 @import 'no-mobile-app';
2 2
 @import 'unsupported-desktop-browser';
3
-@import 'unsupported-mobile-browser';
3
+@import 'unsupported-mobile-browser';

+ 6
- 6
css/unsupported-browser/_no-mobile-app.scss 查看文件

@@ -1,21 +1,21 @@
1 1
 .no-mobile-app {
2 2
     margin: 30% auto 0;
3
-    width: auto;
4 3
     max-width: 25em;
5 4
     text-align: center;
5
+    width: auto;
6 6
 
7 7
     &__title {
8
-        padding-bottom: em(17, 24);
9 8
         border-bottom: 1px solid $auiBorderColor;
9
+        color: $unsupportedBrowserTitleColor;
10 10
         font-weight: 400;
11 11
         letter-spacing: 0.5px;
12
-        color: #fff;
12
+        padding-bottom: em(17, 24);
13 13
     }
14 14
 
15 15
     &__description {
16
-        margin-top: 1em;
17
-        font-size: 17px;
16
+        font-size: $unsupportedBrowserTextSmallFontSize;
18 17
         font-weight: 300;
19 18
         letter-spacing: 1px;
19
+        margin-top: 1em;
20 20
     }
21
-}
21
+}

+ 6
- 6
css/unsupported-browser/_unsupported-desktop-browser.scss 查看文件

@@ -5,22 +5,22 @@
5 5
     text-align: center;
6 6
 
7 7
     &__title {
8
-        color: #fff;
8
+        color: $unsupportedBrowserTitleColor;
9 9
         font-weight: 300;
10
-        font-size: 24px;
10
+        font-size: $unsupportedBrowserTitleFontSize;
11 11
         letter-spacing: 1px;
12 12
     }
13 13
 
14 14
     &__description {
15
-        margin-top: 16px;
16
-        color: rgba(255, 255, 255, 0.7);
15
+        color: $unsupportedDesktopBrowserTextColor;
16
+        font-size: $unsupportedDesktopBrowserTextFontSize;
17 17
         font-weight: 300;
18
-        font-size: 21px;
19 18
         letter-spacing: 1px;
19
+        margin-top: 16px;
20 20
 
21 21
         &_small {
22 22
             @extend .unsupported-desktop-browser__description;
23
-            font-size: 16px;
23
+            font-size: $unsupportedBrowserTextSmallFontSize;
24 24
         }
25 25
     }
26 26
 

+ 9
- 4
react/features/base/util/interceptComponent.js 查看文件

@@ -1,4 +1,4 @@
1
-/* global APP, interfaceConfig */
1
+/* @flow */
2 2
 
3 3
 import { Platform } from '../react';
4 4
 import {
@@ -8,6 +8,9 @@ import {
8 8
     UnsupportedMobileBrowser
9 9
 } from '../../unsupported-browser';
10 10
 
11
+declare var APP: Object;
12
+declare var interfaceConfig: Object;
13
+
11 14
 /**
12 15
  * Array of rules defining whether we should intercept component to render
13 16
  * or not.
@@ -56,11 +59,13 @@ const _RULES = [
56 59
  *
57 60
  * @param {Object|Function} stateOrGetState - Either Redux state object or
58 61
  * getState() function.
59
- * @param {ReactElement} currentComponent - Current route component to render.
62
+ * @param {ReactElement} component - Current route component to render.
60 63
  * @returns {ReactElement} If any of rules is satisfied returns intercepted
61 64
  * component.
62 65
  */
63
-export function interceptComponent(stateOrGetState, currentComponent) {
66
+export function interceptComponent(
67
+        stateOrGetState: Object,
68
+        component: ReactElement<*>) {
64 69
     let result;
65 70
     const state
66 71
         = typeof stateOrGetState === 'function'
@@ -74,5 +79,5 @@ export function interceptComponent(stateOrGetState, currentComponent) {
74 79
         }
75 80
     }
76 81
 
77
-    return result || currentComponent;
82
+    return result || component;
78 83
 }

+ 4
- 1
react/features/conference/components/Conference.web.js 查看文件

@@ -1,4 +1,4 @@
1
-/* global $, APP */
1
+/* @flow */
2 2
 
3 3
 import React, { Component } from 'react';
4 4
 import { connect as reactReduxConnect } from 'react-redux';
@@ -8,6 +8,9 @@ import { Watermarks } from '../../base/react';
8 8
 import { FeedbackButton } from '../../feedback';
9 9
 import { OverlayContainer } from '../../overlay';
10 10
 
11
+declare var $: Function;
12
+declare var APP: Object;
13
+
11 14
 /**
12 15
  * For legacy reasons, inline style for display none.
13 16
  *

+ 7
- 4
react/features/unsupported-browser/components/NoMobileApp.js 查看文件

@@ -1,8 +1,11 @@
1
-/* global interfaceConfig */
1
+/* @flow */
2
+
2 3
 import React, { Component } from 'react';
3 4
 
5
+declare var interfaceConfig: Object;
6
+
4 7
 /**
5
- * React component representing no mobile page.
8
+ * React component representing no mobile app page.
6 9
  *
7 10
  * @class NoMobileApp
8 11
  */
@@ -22,8 +25,8 @@ export default class NoMobileApp extends Component {
22 25
                     Video chat isn't available in the mobile apps
23 26
                 </h2>
24 27
                 <p className = { `${ns}__description` }>
25
-                    Please use { interfaceConfig.APP_NAME } on <br />
26
-                    Desktop top join calls.
28
+                    Video chat isn't available on mobile
29
+                    Desktop to join calls.
27 30
                 </p>
28 31
             </div>
29 32
         );

+ 6
- 3
react/features/unsupported-browser/components/PluginRequiredBrowser.js 查看文件

@@ -1,3 +1,5 @@
1
+/*  @flow */
2
+
1 3
 import React, { Component } from 'react';
2 4
 
3 5
 import { CHROME, CHROMIUM, FIREFOX } from './browserLinks';
@@ -16,6 +18,7 @@ export default class PluginRequiredBrowser extends Component {
16 18
      */
17 19
     render() {
18 20
         const ns = 'unsupported-desktop-browser';
21
+        const nsLink = `${ns}__link`;
19 22
 
20 23
         return (
21 24
             <div className = { ns }>
@@ -28,13 +31,13 @@ export default class PluginRequiredBrowser extends Component {
28 31
                     however, we strongly recommend that you do that using
29 32
                     the&nbsp;
30 33
                     <a
31
-                        className = { `${ns}__link` }
34
+                        className = { nsLink }
32 35
                         href = { CHROME }>Chrome</a>,&nbsp;
33 36
                     <a
34
-                        className = { `${ns}__link` }
37
+                        className = { nsLink }
35 38
                         href = { CHROMIUM }>Chromium</a> or&nbsp;
36 39
                     <a
37
-                        className = { `${ns}__link` }
40
+                        className = { nsLink }
38 41
                         href = { FIREFOX }>Firefox</a> browsers.
39 42
                 </p>
40 43
             </div>

+ 8
- 6
react/features/unsupported-browser/components/UnsupportedDesktopBrowser.js 查看文件

@@ -1,3 +1,5 @@
1
+/* @flow */
2
+
1 3
 import React, { Component } from 'react';
2 4
 
3 5
 import { CHROME, FIREFOX, IE, SAFARI } from './browserLinks';
@@ -8,7 +10,6 @@ import { CHROME, FIREFOX, IE, SAFARI } from './browserLinks';
8 10
  * @class UnsupportedDesktopBrowser
9 11
  */
10 12
 export default class UnsupportedDesktopBrowser extends Component {
11
-
12 13
     /**
13 14
      * Renders the component.
14 15
      *
@@ -16,6 +17,7 @@ export default class UnsupportedDesktopBrowser extends Component {
16 17
      */
17 18
     render() {
18 19
         const ns = 'unsupported-desktop-browser';
20
+        const nsLink = `${ns}__link`;
19 21
 
20 22
         return (
21 23
             <div className = { ns }>
@@ -23,18 +25,18 @@ export default class UnsupportedDesktopBrowser extends Component {
23 25
                     It looks like you're using a browser we don't support.
24 26
                 </h2>
25 27
                 <p className = { `${ns}__description` }>
26
-                    Please try again with&nbsp;
28
+                    Please try again with the latest version of&nbsp;
27 29
                     <a
28
-                        className = { `${ns}__link` }
30
+                        className = { nsLink }
29 31
                         href = { CHROME } >Chrome</a>,&nbsp;
30 32
                     <a
31
-                        className = { `${ns}__link` }
33
+                        className = { nsLink }
32 34
                         href = { FIREFOX }>Firefox</a>,&nbsp;
33 35
                     <a
34
-                        className = { `${ns}__link` }
36
+                        className = { nsLink }
35 37
                         href = { SAFARI }>Safari</a> or&nbsp;
36 38
                     <a
37
-                        className = { `${ns}__link` }
39
+                        className = { nsLink }
38 40
                         href = { IE }>IE</a>.
39 41
                 </p>
40 42
             </div>

+ 4
- 0
react/features/unsupported-browser/components/UnsupportedMobileBrowser.js 查看文件

@@ -1,3 +1,5 @@
1
+/* @flow */
2
+
1 3
 import React, { Component } from 'react';
2 4
 import { connect } from 'react-redux';
3 5
 
@@ -20,6 +22,8 @@ const _URLS = {
20 22
  * @class UnsupportedMobileBrowser
21 23
  */
22 24
 class UnsupportedMobileBrowser extends Component {
25
+    state: Object;
26
+
23 27
     /**
24 28
      * UnsupportedMobileBrowser component's property types.
25 29
      *

Loading…
取消
儲存