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.

HelpView.tsx 2.0KB

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