Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Comply w/ coding style

Lyubomir Marinov7de5c9c1d2e8
diff --git a/css/_landing.scss b/css/_landing.scss
index 138c912408..ccf2aea642 100644
--- a/css/_landing.scss
+++ b/css/_landing.scss
@@ -1,15 +1,15 @@
.landing {
background-color: #fff;
- width: 100vw;
height: 100vh;
padding: 35px 0;
+ width: 100vw;
&__body {
+ color: $landingTextColor;
margin: auto;
- width: 75%;
max-width: 40em;
text-align: center;
- color: $landingTextColor;
+ width: 75%;
a:active {
text-decoration: none;
@@ -18,13 +18,12 @@
&__text {
font-size: 1.8em;
- margin-bottom: 0.65em;
line-height: em(29px, 21px);
+ margin-bottom: 0.65em;
&_small {
- margin-top: em(21, 18);
margin-bottom: 1em;
-
+ margin-top: em(21, 18);
font-size: 1.5em;
strong {
@@ -34,16 +33,16 @@
}
&__logo {
- width: 77px;
height: 108px;
+ width: 77px;
}
&__button {
- margin: 0 auto;
border: 0;
height: 42px;
- width: 98%;
+ margin: 0 auto;
max-width: 300px;
+ width: 98%;
@include border-radius(8px);
background-color: $landingButtonBgColor;
font-size: 1.5em;
@@ -51,9 +50,9 @@
letter-spacing: 0.5px;
text-shadow: 0px 1px 2px $landingTextColor;
- // Disable standard button effects
- outline: none;
+ // Disable standard button effects.
box-shadow: none;
+ outline: none;
&:active {
background-color: $landingButtonBgColor;
@@ -67,4 +66,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/css/_variables.scss b/css/_variables.scss
index edbf89e772..e4b9ecefc8 100644
--- a/css/_variables.scss
+++ b/css/_variables.scss
@@ -129,8 +129,8 @@ $linkFontColor: #489afe;
$linkHoverFontColor: #287ade;
/**
-* Landing
-*/
-$primaryLandingButtonBgColor: #17a0db;
+ * Landing
+ */
$landingButtonBgColor: #ff9a00;
$landingTextColor: #4a4a4a;
+$primaryLandingButtonBgColor: #17a0db;
diff --git a/react/features/app/actionTypes.js b/react/features/app/actionTypes.js
index d3670e525c..65d4ecb3a3 100644
--- a/react/features/app/actionTypes.js
+++ b/react/features/app/actionTypes.js
@@ -1,5 +1,16 @@
import { Symbol } from '../base/react';
+/**
+ * The type of this action sets the platform of user agent in order to decide to
+ * show the landing or not.
+ *
+ * {
+ * type: APP_SET_PLATFORM,
+ * platform: string
+ * }
+ */
+export const APP_SET_PLATFORM = Symbol('APP_SET_PLATFORM');
+
/**
* The type of the actions which signals that a specific App will mount (in the
* terms of React).
@@ -21,14 +32,3 @@ export const APP_WILL_MOUNT = Symbol('APP_WILL_MOUNT');
* }
*/
export const APP_WILL_UNMOUNT = Symbol('APP_WILL_UNMOUNT');
-
-/**
- * The type of this action sets the platform of user agent
- * in order to decide to show the landing or not.
- *
- * {
- * type: APP_SET_PLATFORM,
- * platform: String
- * }
- */
-export const APP_SET_PLATFORM = Symbol('APP_SET_PLATFORM');
diff --git a/react/features/app/actions.js b/react/features/app/actions.js
index d1268e8651..f216b28fac 100644
--- a/react/features/app/actions.js
+++ b/react/features/app/actions.js
@@ -118,37 +118,6 @@ export function appWillMount(app) {
};
}
-/**
- * Detects the platform of user agent and
- * signals that platform detected.
- *
- * @returns {Function}
- */
-export function detectPlatform() {
- return dispatch => {
- if (detectAndroid()) {
- dispatch(_setPlatform('android'));
- } else if (detectIOS()) {
- dispatch(_setPlatform('ios'));
- }
- };
-}
-
-/**
- * Signals that user agent platform is mobile and it has
- * been already detected.
- *
- * @param {string} platform - Mobile user agent platform.
- * @returns {{type, platform: string}}
- * @private
- */
-export function _setPlatform(platform) {
- return {
- type: APP_SET_PLATFORM,
- platform
- };
-}
-
/**
* Signals that a specific App will unmount (in the terms of React).
*
@@ -165,6 +134,21 @@ export function appWillUnmount(app) {
};
}
+/**
+ * Detects the platform of user agent and signals that platform detected.
+ *
+ * @returns {Function}
+ */
+export function detectPlatform() {
+ return dispatch => {
+ if (detectAndroid()) {
+ dispatch(_setPlatform('android'));
+ } else if (detectIOS()) {
+ dispatch(_setPlatform('ios'));
+ }
+ };
+}
+
/**
* Navigates to route corresponding to current room name.
*
@@ -179,6 +163,23 @@ function _navigate(state) {
app._navigate(routeToRender);
}
+/**
+ * Signals that user agent platform is mobile and it has been already detected.
+ *
+ * @param {string} platform - Mobile user agent platform.
+ * @returns {{
+ * type: APP_SET_PLATFORM,
+ * platform: string
+ * }}
+ * @private
+ */
+function _setPlatform(platform) {
+ return {
+ type: APP_SET_PLATFORM,
+ platform
+ };
+}
+
/**
* Sets room and navigates to new route if needed.
*
diff --git a/react/features/app/functions.native.js b/react/features/app/functions.native.js
index be984f2c00..5f6db5c964 100644
--- a/react/features/app/functions.native.js
+++ b/react/features/app/functions.native.js
@@ -1,6 +1,5 @@
import { isRoomValid } from '../base/conference';
import { RouteRegistry } from '../base/navigator';
-
import { Conference } from '../conference';
import { WelcomePage } from '../welcome';
@@ -86,8 +85,8 @@ export function _getRoomAndDomainFromUrlString(url) {
export function _getRouteToRender(stateOrGetState) {
const state
= typeof stateOrGetState === 'function'
- ? stateOrGetState()
- : stateOrGetState;
+ ? stateOrGetState()
+ : stateOrGetState;
const room = state['features/base/conference'].room;
const component = isRoomValid(room) ? Conference : WelcomePage;
diff --git a/react/features/app/functions.web.js b/react/features/app/functions.web.js
index 1ee98fabd8..34994839f0 100644
--- a/react/features/app/functions.web.js
+++ b/react/features/app/functions.web.js
@@ -16,7 +16,7 @@ import { WelcomePage } from '../welcome';
const Logger = require('jitsi-meet-logger');
-export * from './functions.native';
+export { _getRoomAndDomainFromUrlString } from './functions.native';
/**
* Determines which route is to be rendered in order to depict a specific Redux
diff --git a/react/features/base/util/detectDevices.js b/react/features/base/util/detectDevices.js
index 4b203e45c6..3385e65041 100644
--- a/react/features/base/util/detectDevices.js
+++ b/react/features/base/util/detectDevices.js
@@ -13,11 +13,5 @@ export function detectAndroid() {
* @returns {boolean}
*/
export function detectIOS() {
- if (navigator.userAgent.match(/iPhone/i)
- || navigator.userAgent.match(/iPad/i)
- || navigator.userAgent.match(/iPod/i)) {
- return true;
- }
-
- return false;
+ return Boolean(navigator.userAgent.match(/iP(ad|hone|od)/i));
}
diff --git a/react/features/base/util/index.js b/react/features/base/util/index.js
index eb4ba73f94..f3159ab71e 100644
--- a/react/features/base/util/index.js
+++ b/react/features/base/util/index.js
@@ -1,3 +1,3 @@
+export * from './detectDevices';
export * from './loadScript';
export * from './roomnameGenerator';
-export * from './detectDevices';
diff --git a/react/features/conference/route.js b/react/features/conference/route.js
index da55ce662f..5cfed13114 100644
--- a/react/features/conference/route.js
+++ b/react/features/conference/route.js
@@ -5,6 +5,7 @@ import HttpConfigFetch from '../../../modules/config/HttpConfigFetch';
import ConferenceUrl from '../../../modules/URL/ConferenceUrl';
import { RouteRegistry } from '../base/navigator';
+
import { Conference } from './components';
const logger = require('jitsi-meet-logger').getLogger(__filename);
diff --git a/react/features/landing/actionTypes.js b/react/features/landing/actionTypes.js
index c881c6588e..6200c12941 100644
--- a/react/features/landing/actionTypes.js
+++ b/react/features/landing/actionTypes.js
@@ -1,11 +1,10 @@
import { Symbol } from '../base/react';
/**
- * The type of the actions which signals that a mobile landing is shown.
+ * The type of the Redux action which signals that a mobile landing is shown.
*
* {
* type: LANDING_IS_SHOWN
* }
*/
export const LANDING_IS_SHOWN = Symbol('LANDING_IS_SHOWN');
-
diff --git a/react/features/landing/components/Landing.js b/react/features/landing/components/Landing.js
index 759ad60112..4b66912d0f 100644
--- a/react/features/landing/components/Landing.js
+++ b/react/features/landing/components/Landing.js
@@ -1,11 +1,12 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router';
+
import { landingIsShown } from '../actions';
-const links = {
+const LINKS = {
'android': 'https://play.google.com/store/apps/details?id=org.jitsi.meet',
- 'ios': ''
+ 'ios': 'https://itunes.apple.com/us/app/jitsi-meet/id1165103905'
};
/**
@@ -14,10 +15,14 @@ const links = {
* @class Landing
*/
class Landing extends Component {
+ static propTypes = {
+ dispatch: React.PropTypes.func,
+ platform: React.PropTypes.string,
+ room: React.PropTypes.string
+ }
/**
- * React lifecycle method triggered after
- * component is mount.
+ * React lifecycle method triggered after component is mounted.
*
* @returns {void}
*/
@@ -25,15 +30,8 @@ class Landing extends Component {
this.props.dispatch(landingIsShown());
}
- static propTypes = {
- dispatch: React.PropTypes.func,
- platform: React.PropTypes.string,
- room: React.PropTypes.string
- };
-
/**
- * React lifecycle method triggered before
- * component will mount.
+ * React lifecycle method triggered before component will mount.
*
* @returns {void}
*/
@@ -72,10 +70,10 @@ class Landing extends Component {
className = 'landing__logo'
src = '/images/logo-blue.svg' />
<p className = 'landing__text'>
- You need <strong>Meet Jitsi</strong> to
- join a conversation on your mobile
+ You need <strong>Jitsi Meet</strong> to join a
+ conversation on your mobile
</p>
- <a href = { links[platform] }>
+ <a href = { LINKS[platform] }>
<button
className = { primaryButtonClasses }>
Download the App
@@ -95,11 +93,20 @@ class Landing extends Component {
}
}
-const mapStateToProps = state => {
+/**
+ * Maps (parts of) the Redux state to the associated Landing's props.
+ *
+ * @param {Object} state - Redux state.
+ * @returns {{
+ * platform: string,
+ * room: string
+ * }}
+ */
+function mapStateToProps(state) {
return {
platform: state['features/app'].platform,
room: state['features/base/conference'].room
};
-};
+}
export default connect(mapStateToProps)(Landing);
diff --git a/react/features/landing/reducer.js b/react/features/landing/reducer.js
index a6d504fb13..bbd8d13fb2 100644
--- a/react/features/landing/reducer.js
+++ b/react/features/landing/reducer.js
@@ -9,9 +9,9 @@ ReducerRegistry.register('features/landing', (state = {}, action) => {
...state,
/**
- * Flag that shows that mobile landing shown shown.
+ * Flag that shows that mobile landing is shown.
*
- * @type {App}
+ * @type {boolean}
*/
landingIsShown: true
};
diff --git a/react/features/landing/route.js b/react/features/landing/route.js
index da1c4bcce4..e38da3a021 100644
--- a/react/features/landing/route.js
+++ b/react/features/landing/route.js
@@ -1,4 +1,5 @@
import { RouteRegistry } from '../base/navigator';
+
import { Landing } from './components';
RouteRegistry.register({