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

HelpView.js 2.0KB

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