Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

HelpView.tsx 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* eslint-disable lines-around-comment */
  2. import React, { PureComponent } from 'react';
  3. import { IReduxState } from '../../../app/types';
  4. // @ts-ignore
  5. import JitsiScreenWebView from '../../../base/modal/components/JitsiScreenWebView';
  6. // @ts-ignore
  7. import JitsiStatusBar from '../../../base/modal/components/JitsiStatusBar';
  8. import { connect } from '../../../base/redux/functions';
  9. // @ts-ignore
  10. import { renderArrowBackButton }
  11. // @ts-ignore
  12. from '../../../mobile/navigation/components/welcome/functions';
  13. // @ts-ignore
  14. import styles from './styles';
  15. const DEFAULT_HELP_CENTRE_URL = 'https://web-cdn.jitsi.net/faq/meet-faq.html';
  16. interface IProps {
  17. /**
  18. * The URL to display in the Help Centre.
  19. */
  20. _url: string;
  21. /**
  22. * Default prop for navigating between screen components(React Navigation).
  23. */
  24. navigation: Object;
  25. }
  26. /**
  27. * Implements a page that renders the help content for the app.
  28. */
  29. class HelpView extends PureComponent<IProps> {
  30. /**
  31. * Implements React's {@link Component#componentDidMount()}. Invoked
  32. * immediately after mounting occurs.
  33. *
  34. * @inheritdoc
  35. * @returns {void}
  36. */
  37. componentDidMount() {
  38. const {
  39. navigation
  40. } = this.props;
  41. // @ts-ignore
  42. navigation.setOptions({
  43. headerLeft: () =>
  44. renderArrowBackButton(() =>
  45. // @ts-ignore
  46. navigation.goBack())
  47. });
  48. }
  49. /**
  50. * Implements {@code PureComponent#render()}.
  51. *
  52. * @inheritdoc
  53. * @returns {ReactElement}
  54. */
  55. render() {
  56. return (
  57. <>
  58. <JitsiStatusBar />
  59. <JitsiScreenWebView
  60. source = { this.props._url }
  61. style = { styles.screenContainer } />
  62. </>
  63. );
  64. }
  65. }
  66. /**
  67. * Maps part of the Redux state to the props of this component.
  68. *
  69. * @param {Object} state - The Redux state.
  70. * @returns {IProps}
  71. */
  72. function _mapStateToProps(state: IReduxState) {
  73. return {
  74. _url: state['features/base/config'].helpCentreURL || DEFAULT_HELP_CENTRE_URL
  75. };
  76. }
  77. export default connect(_mapStateToProps)(HelpView);