Comply w/ coding style

This commit is contained in:
Lyubomir Marinov 2017-01-13 16:37:53 -06:00
parent 8248b14555
commit 7de5c9c1d2
13 changed files with 91 additions and 90 deletions

View File

@ -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 @@
}
}
}
}
}

View File

@ -129,8 +129,8 @@ $linkFontColor: #489afe;
$linkHoverFontColor: #287ade;
/**
* Landing
*/
$primaryLandingButtonBgColor: #17a0db;
* Landing
*/
$landingButtonBgColor: #ff9a00;
$landingTextColor: #4a4a4a;
$primaryLandingButtonBgColor: #17a0db;

View File

@ -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');

View File

@ -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.
*

View File

@ -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;

View File

@ -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

View File

@ -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));
}

View File

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

View File

@ -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);

View File

@ -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');

View File

@ -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);

View File

@ -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
};

View File

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