jiti-meet/react/features/deep-linking/components/NoMobileApp.web.js

77 lines
1.8 KiB
JavaScript
Raw Normal View History

2017-02-07 14:45:51 +00:00
/* @flow */
2017-02-03 12:51:39 +00:00
import React, { Component } from 'react';
import { createDeepLinkingPageEvent, sendAnalytics } from '../../analytics';
import { IDeeplinkingConfig } from '../../base/config/configType';
import { connect } from '../../base/redux';
2017-02-16 20:00:54 +00:00
/**
* The type of the React {@code Component} props of
* {@link NoMobileApp}.
*/
type Props = {
/**
* The deeplinking config.
*/
_deeplinkingCfg: IDeeplinkingConfig,
};
2017-02-07 14:45:51 +00:00
2017-02-03 12:51:39 +00:00
/**
2017-02-07 14:45:51 +00:00
* React component representing no mobile app page.
2017-02-03 12:51:39 +00:00
*
* @class NoMobileApp
*/
class NoMobileApp<P : Props> extends Component<P> {
/**
* Implements the Component's componentDidMount method.
*
* @inheritdoc
*/
componentDidMount() {
sendAnalytics(
createDeepLinkingPageEvent(
'displayed', 'noMobileApp', { isMobileBrowser: true }));
}
2017-02-03 12:51:39 +00:00
/**
* Renders the component.
*
* @returns {ReactElement}
*/
render() {
const ns = 'no-mobile-app';
const { desktop: { appName } } = this.props._deeplinkingCfg;
2017-02-03 12:51:39 +00:00
return (
<div className = { ns }>
<h2 className = { `${ns}__title` }>
2017-02-28 04:31:55 +00:00
Video chat isn't available on mobile.
2017-02-03 12:51:39 +00:00
</h2>
<p className = { `${ns}__description` }>
Please use { appName } on desktop to
join calls.
2017-02-03 12:51:39 +00:00
</p>
</div>
);
}
}
/**
* Maps (parts of) the Redux state to the associated props for the
* {@code NoMobileApp} component.
*
* @param {Object} state - The Redux state.
* @private
* @returns {Props}
*/
function _mapStateToProps(state) {
return {
_deeplinkingCfg: state['features/base/config'].deeplinking || {}
};
}
export default connect(_mapStateToProps)(NoMobileApp);