Files
jitsi-meet/react/features/deep-linking/components/NoMobileApp.web.tsx

78 lines
1.9 KiB
TypeScript
Raw Normal View History

2017-02-03 14:51:39 +02:00
import React, { Component } from 'react';
import { connect } from 'react-redux';
2017-02-03 14:51:39 +02:00
import { createDeepLinkingPageEvent } from '../../analytics/AnalyticsEvents';
import { sendAnalytics } from '../../analytics/functions';
import { IReduxState } from '../../app/types';
import { IDeeplinkingConfig } from '../../base/config/configType';
2017-02-16 14:00:54 -06:00
/**
* The type of the React {@code Component} props of
* {@link NoMobileApp}.
*/
interface IProps {
/**
* The deeplinking config.
*/
_deeplinkingCfg: IDeeplinkingConfig;
}
2017-02-07 16:45:51 +02:00
2017-02-03 14:51:39 +02:00
/**
2017-02-07 16:45:51 +02:00
* React component representing no mobile app page.
2017-02-03 14:51:39 +02:00
*
* @class NoMobileApp
*/
class NoMobileApp extends Component<IProps> {
/**
* Implements the Component's componentDidMount method.
*
* @inheritdoc
*/
componentDidMount() {
sendAnalytics(
createDeepLinkingPageEvent(
'displayed', 'noMobileApp', { isMobileBrowser: true }));
}
2017-02-03 14:51:39 +02:00
/**
* Renders the component.
*
* @returns {ReactElement}
*/
render() {
const ns = 'no-mobile-app';
const { desktop } = this.props._deeplinkingCfg;
const { appName } = desktop ?? {};
2017-02-03 14:51:39 +02:00
return (
<div className = { ns }>
<h2 className = { `${ns}__title` }>
2017-02-27 22:31:55 -06:00
Video chat isn't available on mobile.
2017-02-03 14:51:39 +02:00
</h2>
<p className = { `${ns}__description` }>
Please use { appName } on desktop to
join calls.
2017-02-03 14:51:39 +02: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 {IProps}
*/
function _mapStateToProps(state: IReduxState) {
return {
_deeplinkingCfg: state['features/base/config'].deeplinking || {}
};
}
export default connect(_mapStateToProps)(NoMobileApp);