Bladeren bron

Comply w/ coding style

j8
Lyubomir Marinov 8 jaren geleden
bovenliggende
commit
7de5c9c1d2

+ 11
- 12
css/_landing.scss Bestand weergeven

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

+ 3
- 3
css/_variables.scss Bestand weergeven

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

+ 11
- 11
react/features/app/actionTypes.js Bestand weergeven

1
 import { Symbol } from '../base/react';
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
  * The type of the actions which signals that a specific App will mount (in the
15
  * The type of the actions which signals that a specific App will mount (in the
5
  * terms of React).
16
  * terms of React).
21
  * }
32
  * }
22
  */
33
  */
23
 export const APP_WILL_UNMOUNT = Symbol('APP_WILL_UNMOUNT');
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 Bestand weergeven

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
  * Signals that a specific App will unmount (in the terms of React).
122
  * Signals that a specific App will unmount (in the terms of React).
154
  *
123
  *
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
  * Navigates to route corresponding to current room name.
153
  * Navigates to route corresponding to current room name.
170
  *
154
  *
179
     app._navigate(routeToRender);
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
  * Sets room and navigates to new route if needed.
184
  * Sets room and navigates to new route if needed.
184
  *
185
  *

+ 2
- 3
react/features/app/functions.native.js Bestand weergeven

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

+ 1
- 1
react/features/app/functions.web.js Bestand weergeven

16
 
16
 
17
 const Logger = require('jitsi-meet-logger');
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
  * Determines which route is to be rendered in order to depict a specific Redux
22
  * Determines which route is to be rendered in order to depict a specific Redux

+ 1
- 7
react/features/base/util/detectDevices.js Bestand weergeven

13
  * @returns {boolean}
13
  * @returns {boolean}
14
  */
14
  */
15
 export function detectIOS() {
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 Bestand weergeven

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

+ 1
- 0
react/features/conference/route.js Bestand weergeven

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

+ 1
- 2
react/features/landing/actionTypes.js Bestand weergeven

1
 import { Symbol } from '../base/react';
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
  *     type: LANDING_IS_SHOWN
7
  *     type: LANDING_IS_SHOWN
8
  * }
8
  * }
9
  */
9
  */
10
 export const LANDING_IS_SHOWN = Symbol('LANDING_IS_SHOWN');
10
 export const LANDING_IS_SHOWN = Symbol('LANDING_IS_SHOWN');
11
-

+ 24
- 17
react/features/landing/components/Landing.js Bestand weergeven

1
 import React, { Component } from 'react';
1
 import React, { Component } from 'react';
2
 import { connect } from 'react-redux';
2
 import { connect } from 'react-redux';
3
 import { Link } from 'react-router';
3
 import { Link } from 'react-router';
4
+
4
 import { landingIsShown } from '../actions';
5
 import { landingIsShown } from '../actions';
5
 
6
 
6
-const links = {
7
+const LINKS = {
7
     'android': 'https://play.google.com/store/apps/details?id=org.jitsi.meet',
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
  * @class Landing
15
  * @class Landing
15
  */
16
  */
16
 class Landing extends Component {
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
      * @returns {void}
27
      * @returns {void}
23
      */
28
      */
25
         this.props.dispatch(landingIsShown());
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
      * @returns {void}
36
      * @returns {void}
39
      */
37
      */
72
                         className = 'landing__logo'
70
                         className = 'landing__logo'
73
                         src = '/images/logo-blue.svg' />
71
                         src = '/images/logo-blue.svg' />
74
                     <p className = 'landing__text'>
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
                     </p>
75
                     </p>
78
-                    <a href = { links[platform] }>
76
+                    <a href = { LINKS[platform] }>
79
                         <button
77
                         <button
80
                             className = { primaryButtonClasses }>
78
                             className = { primaryButtonClasses }>
81
                             Download the App
79
                             Download the App
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
     return {
106
     return {
100
         platform: state['features/app'].platform,
107
         platform: state['features/app'].platform,
101
         room: state['features/base/conference'].room
108
         room: state['features/base/conference'].room
102
     };
109
     };
103
-};
110
+}
104
 
111
 
105
 export default connect(mapStateToProps)(Landing);
112
 export default connect(mapStateToProps)(Landing);

+ 2
- 2
react/features/landing/reducer.js Bestand weergeven

9
             ...state,
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
             landingIsShown: true
16
             landingIsShown: true
17
         };
17
         };

+ 1
- 0
react/features/landing/route.js Bestand weergeven

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

Laden…
Annuleren
Opslaan