您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

NoMobileApp.web.tsx 1.9KB

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