You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

NoMobileApp.web.js 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* @flow */
  2. import React, { Component } from 'react';
  3. import { createDeepLinkingPageEvent, sendAnalytics } from '../../analytics';
  4. import { IDeeplinkingConfig } from '../../base/config/configType';
  5. import { connect } from '../../base/redux';
  6. /**
  7. * The type of the React {@code Component} props of
  8. * {@link NoMobileApp}.
  9. */
  10. type Props = {
  11. /**
  12. * The deeplinking config.
  13. */
  14. _deeplinkingCfg: IDeeplinkingConfig,
  15. };
  16. /**
  17. * React component representing no mobile app page.
  18. *
  19. * @class NoMobileApp
  20. */
  21. class NoMobileApp<P : Props> extends Component<P> {
  22. /**
  23. * Implements the Component's componentDidMount method.
  24. *
  25. * @inheritdoc
  26. */
  27. componentDidMount() {
  28. sendAnalytics(
  29. createDeepLinkingPageEvent(
  30. 'displayed', 'noMobileApp', { isMobileBrowser: true }));
  31. }
  32. /**
  33. * Renders the component.
  34. *
  35. * @returns {ReactElement}
  36. */
  37. render() {
  38. const ns = 'no-mobile-app';
  39. const { desktop: { appName } } = this.props._deeplinkingCfg;
  40. return (
  41. <div className = { ns }>
  42. <h2 className = { `${ns}__title` }>
  43. Video chat isn't available on mobile.
  44. </h2>
  45. <p className = { `${ns}__description` }>
  46. Please use { appName } on desktop to
  47. join calls.
  48. </p>
  49. </div>
  50. );
  51. }
  52. }
  53. /**
  54. * Maps (parts of) the Redux state to the associated props for the
  55. * {@code NoMobileApp} component.
  56. *
  57. * @param {Object} state - The Redux state.
  58. * @private
  59. * @returns {Props}
  60. */
  61. function _mapStateToProps(state) {
  62. return {
  63. _deeplinkingCfg: state['features/base/config'].deeplinking || {}
  64. };
  65. }
  66. export default connect(_mapStateToProps)(NoMobileApp);