瀏覽代碼

Comply w/ coding style

j8
Lyubomir Marinov 8 年之前
父節點
當前提交
7de5c9c1d2

+ 11
- 12
css/_landing.scss 查看文件

@@ -1,15 +1,15 @@
1 1
 .landing {
2 2
     background-color: #fff;
3
-    width: 100vw;
4 3
     height: 100vh;
5 4
     padding: 35px 0;
5
+    width: 100vw;
6 6
 
7 7
     &__body {
8
+        color: $landingTextColor;
8 9
         margin: auto;
9
-        width: 75%;
10 10
         max-width: 40em;
11 11
         text-align: center;
12
-        color: $landingTextColor;
12
+        width: 75%;
13 13
 
14 14
         a:active {
15 15
             text-decoration: none;
@@ -18,13 +18,12 @@
18 18
 
19 19
     &__text {
20 20
         font-size: 1.8em;
21
-        margin-bottom: 0.65em;
22 21
         line-height: em(29px, 21px);
22
+        margin-bottom: 0.65em;
23 23
 
24 24
         &_small {
25
-            margin-top: em(21, 18);
26 25
             margin-bottom: 1em;
27
-
26
+            margin-top: em(21, 18);
28 27
             font-size: 1.5em;
29 28
 
30 29
             strong {
@@ -34,16 +33,16 @@
34 33
     }
35 34
 
36 35
     &__logo {
37
-        width: 77px;
38 36
         height: 108px;
37
+        width: 77px;
39 38
     }
40 39
 
41 40
     &__button {
42
-        margin: 0 auto;
43 41
         border: 0;
44 42
         height: 42px;
45
-        width: 98%;
43
+        margin: 0 auto;
46 44
         max-width: 300px;
45
+        width: 98%;
47 46
         @include border-radius(8px);
48 47
         background-color: $landingButtonBgColor;
49 48
         font-size: 1.5em;
@@ -51,9 +50,9 @@
51 50
         letter-spacing: 0.5px;
52 51
         text-shadow: 0px 1px 2px $landingTextColor;
53 52
 
54
-        // Disable standard button effects
55
-        outline: none;
53
+        // Disable standard button effects.
56 54
         box-shadow: none;
55
+        outline: none;
57 56
 
58 57
         &:active {
59 58
             background-color: $landingButtonBgColor;
@@ -67,4 +66,4 @@
67 66
             }
68 67
         }
69 68
     }
70
-}
69
+}

+ 3
- 3
css/_variables.scss 查看文件

@@ -129,8 +129,8 @@ $linkFontColor: #489afe;
129 129
 $linkHoverFontColor: #287ade;
130 130
 
131 131
 /**
132
-* Landing
133
-*/
134
-$primaryLandingButtonBgColor: #17a0db;
132
+ * Landing
133
+ */
135 134
 $landingButtonBgColor: #ff9a00;
136 135
 $landingTextColor: #4a4a4a;
136
+$primaryLandingButtonBgColor: #17a0db;

+ 11
- 11
react/features/app/actionTypes.js 查看文件

@@ -1,5 +1,16 @@
1 1
 import { Symbol } from '../base/react';
2 2
 
3
+/**
4
+ * The type of this action sets the platform of user agent in order to decide to
5
+ * show the landing or not.
6
+ *
7
+ * {
8
+ *      type: APP_SET_PLATFORM,
9
+ *      platform: string
10
+ * }
11
+ */
12
+export const APP_SET_PLATFORM = Symbol('APP_SET_PLATFORM');
13
+
3 14
 /**
4 15
  * The type of the actions which signals that a specific App will mount (in the
5 16
  * terms of React).
@@ -21,14 +32,3 @@ export const APP_WILL_MOUNT = Symbol('APP_WILL_MOUNT');
21 32
  * }
22 33
  */
23 34
 export const APP_WILL_UNMOUNT = Symbol('APP_WILL_UNMOUNT');
24
-
25
-/**
26
- * The type of this action sets the platform of user agent
27
- * in order to decide to show the landing or not.
28
- *
29
- * {
30
- *      type: APP_SET_PLATFORM,
31
- *      platform: String
32
- * }
33
- */
34
-export const APP_SET_PLATFORM = Symbol('APP_SET_PLATFORM');

+ 32
- 31
react/features/app/actions.js 查看文件

@@ -118,37 +118,6 @@ export function appWillMount(app) {
118 118
     };
119 119
 }
120 120
 
121
-/**
122
- * Detects the platform of user agent and
123
- * signals that platform detected.
124
- *
125
- * @returns {Function}
126
- */
127
-export function detectPlatform() {
128
-    return dispatch => {
129
-        if (detectAndroid()) {
130
-            dispatch(_setPlatform('android'));
131
-        } else if (detectIOS()) {
132
-            dispatch(_setPlatform('ios'));
133
-        }
134
-    };
135
-}
136
-
137
-/**
138
- * Signals that user agent platform is mobile and it has
139
- * been already detected.
140
- *
141
- * @param {string} platform - Mobile user agent platform.
142
- * @returns {{type, platform: string}}
143
- * @private
144
- */
145
-export function _setPlatform(platform) {
146
-    return {
147
-        type: APP_SET_PLATFORM,
148
-        platform
149
-    };
150
-}
151
-
152 121
 /**
153 122
  * Signals that a specific App will unmount (in the terms of React).
154 123
  *
@@ -165,6 +134,21 @@ export function appWillUnmount(app) {
165 134
     };
166 135
 }
167 136
 
137
+/**
138
+ * Detects the platform of user agent and signals that platform detected.
139
+ *
140
+ * @returns {Function}
141
+ */
142
+export function detectPlatform() {
143
+    return dispatch => {
144
+        if (detectAndroid()) {
145
+            dispatch(_setPlatform('android'));
146
+        } else if (detectIOS()) {
147
+            dispatch(_setPlatform('ios'));
148
+        }
149
+    };
150
+}
151
+
168 152
 /**
169 153
  * Navigates to route corresponding to current room name.
170 154
  *
@@ -179,6 +163,23 @@ function _navigate(state) {
179 163
     app._navigate(routeToRender);
180 164
 }
181 165
 
166
+/**
167
+ * Signals that user agent platform is mobile and it has been already detected.
168
+ *
169
+ * @param {string} platform - Mobile user agent platform.
170
+ * @returns {{
171
+ *     type: APP_SET_PLATFORM,
172
+ *     platform: string
173
+ * }}
174
+ * @private
175
+ */
176
+function _setPlatform(platform) {
177
+    return {
178
+        type: APP_SET_PLATFORM,
179
+        platform
180
+    };
181
+}
182
+
182 183
 /**
183 184
  * Sets room and navigates to new route if needed.
184 185
  *

+ 2
- 3
react/features/app/functions.native.js 查看文件

@@ -1,6 +1,5 @@
1 1
 import { isRoomValid } from '../base/conference';
2 2
 import { RouteRegistry } from '../base/navigator';
3
-
4 3
 import { Conference } from '../conference';
5 4
 import { WelcomePage } from '../welcome';
6 5
 
@@ -86,8 +85,8 @@ export function _getRoomAndDomainFromUrlString(url) {
86 85
 export function _getRouteToRender(stateOrGetState) {
87 86
     const state
88 87
         = typeof stateOrGetState === 'function'
89
-        ? stateOrGetState()
90
-        : stateOrGetState;
88
+            ? stateOrGetState()
89
+            : stateOrGetState;
91 90
     const room = state['features/base/conference'].room;
92 91
     const component = isRoomValid(room) ? Conference : WelcomePage;
93 92
 

+ 1
- 1
react/features/app/functions.web.js 查看文件

@@ -16,7 +16,7 @@ import { WelcomePage } from '../welcome';
16 16
 
17 17
 const Logger = require('jitsi-meet-logger');
18 18
 
19
-export * from './functions.native';
19
+export { _getRoomAndDomainFromUrlString } from './functions.native';
20 20
 
21 21
 /**
22 22
  * Determines which route is to be rendered in order to depict a specific Redux

+ 1
- 7
react/features/base/util/detectDevices.js 查看文件

@@ -13,11 +13,5 @@ export function detectAndroid() {
13 13
  * @returns {boolean}
14 14
  */
15 15
 export function detectIOS() {
16
-    if (navigator.userAgent.match(/iPhone/i)
17
-        || navigator.userAgent.match(/iPad/i)
18
-        || navigator.userAgent.match(/iPod/i)) {
19
-        return true;
20
-    }
21
-
22
-    return false;
16
+    return Boolean(navigator.userAgent.match(/iP(ad|hone|od)/i));
23 17
 }

+ 1
- 1
react/features/base/util/index.js 查看文件

@@ -1,3 +1,3 @@
1
+export * from './detectDevices';
1 2
 export * from './loadScript';
2 3
 export * from './roomnameGenerator';
3
-export * from './detectDevices';

+ 1
- 0
react/features/conference/route.js 查看文件

@@ -5,6 +5,7 @@ import HttpConfigFetch from '../../../modules/config/HttpConfigFetch';
5 5
 import ConferenceUrl from '../../../modules/URL/ConferenceUrl';
6 6
 
7 7
 import { RouteRegistry } from '../base/navigator';
8
+
8 9
 import { Conference } from './components';
9 10
 
10 11
 const logger = require('jitsi-meet-logger').getLogger(__filename);

+ 1
- 2
react/features/landing/actionTypes.js 查看文件

@@ -1,11 +1,10 @@
1 1
 import { Symbol } from '../base/react';
2 2
 
3 3
 /**
4
- * The type of the actions which signals that a mobile landing is shown.
4
+ * The type of the Redux action which signals that a mobile landing is shown.
5 5
  *
6 6
  * {
7 7
  *     type: LANDING_IS_SHOWN
8 8
  * }
9 9
  */
10 10
 export const LANDING_IS_SHOWN = Symbol('LANDING_IS_SHOWN');
11
-

+ 24
- 17
react/features/landing/components/Landing.js 查看文件

@@ -1,11 +1,12 @@
1 1
 import React, { Component } from 'react';
2 2
 import { connect } from 'react-redux';
3 3
 import { Link } from 'react-router';
4
+
4 5
 import { landingIsShown } from '../actions';
5 6
 
6
-const links = {
7
+const LINKS = {
7 8
     'android': 'https://play.google.com/store/apps/details?id=org.jitsi.meet',
8
-    'ios': ''
9
+    'ios': 'https://itunes.apple.com/us/app/jitsi-meet/id1165103905'
9 10
 };
10 11
 
11 12
 /**
@@ -14,10 +15,14 @@ const links = {
14 15
  * @class Landing
15 16
  */
16 17
 class Landing extends Component {
18
+    static propTypes = {
19
+        dispatch: React.PropTypes.func,
20
+        platform: React.PropTypes.string,
21
+        room: React.PropTypes.string
22
+    }
17 23
 
18 24
     /**
19
-     * React lifecycle method triggered after
20
-     * component is mount.
25
+     * React lifecycle method triggered after component is mounted.
21 26
      *
22 27
      * @returns {void}
23 28
      */
@@ -25,15 +30,8 @@ class Landing extends Component {
25 30
         this.props.dispatch(landingIsShown());
26 31
     }
27 32
 
28
-    static propTypes = {
29
-        dispatch: React.PropTypes.func,
30
-        platform: React.PropTypes.string,
31
-        room: React.PropTypes.string
32
-    };
33
-
34 33
     /**
35
-     * React lifecycle method triggered before
36
-     * component will mount.
34
+     * React lifecycle method triggered before component will mount.
37 35
      *
38 36
      * @returns {void}
39 37
      */
@@ -72,10 +70,10 @@ class Landing extends Component {
72 70
                         className = 'landing__logo'
73 71
                         src = '/images/logo-blue.svg' />
74 72
                     <p className = 'landing__text'>
75
-                       You need <strong>Meet Jitsi</strong> to
76
-                       join a conversation on your mobile
73
+                       You need <strong>Jitsi Meet</strong> to join a
74
+                       conversation on your mobile
77 75
                     </p>
78
-                    <a href = { links[platform] }>
76
+                    <a href = { LINKS[platform] }>
79 77
                         <button
80 78
                             className = { primaryButtonClasses }>
81 79
                             Download the App
@@ -95,11 +93,20 @@ class Landing extends Component {
95 93
     }
96 94
 }
97 95
 
98
-const mapStateToProps = state => {
96
+/**
97
+ * Maps (parts of) the Redux state to the associated Landing's props.
98
+ *
99
+ * @param {Object} state - Redux state.
100
+ * @returns {{
101
+ *     platform: string,
102
+ *     room: string
103
+ * }}
104
+ */
105
+function mapStateToProps(state) {
99 106
     return {
100 107
         platform: state['features/app'].platform,
101 108
         room: state['features/base/conference'].room
102 109
     };
103
-};
110
+}
104 111
 
105 112
 export default connect(mapStateToProps)(Landing);

+ 2
- 2
react/features/landing/reducer.js 查看文件

@@ -9,9 +9,9 @@ ReducerRegistry.register('features/landing', (state = {}, action) => {
9 9
             ...state,
10 10
 
11 11
             /**
12
-             * Flag that shows that mobile landing shown shown.
12
+             * Flag that shows that mobile landing is shown.
13 13
              *
14
-             * @type {App}
14
+             * @type {boolean}
15 15
              */
16 16
             landingIsShown: true
17 17
         };

+ 1
- 0
react/features/landing/route.js 查看文件

@@ -1,4 +1,5 @@
1 1
 import { RouteRegistry } from '../base/navigator';
2
+
2 3
 import { Landing } from './components';
3 4
 
4 5
 RouteRegistry.register({

Loading…
取消
儲存