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.js 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // @flow
  2. import React, { PureComponent } from 'react';
  3. import WebView from 'react-native-webview';
  4. import { JitsiModal } from '../../base/modal';
  5. import { connect } from '../../base/redux';
  6. import { HELP_VIEW_MODAL_ID } from '../constants';
  7. const DEFAULT_HELP_CENTRE_URL = 'https://web-cdn.jitsi.net/faq/meet-faq.html';
  8. type Props = {
  9. /**
  10. * The URL to display in the Help Centre.
  11. */
  12. _url: string
  13. }
  14. /**
  15. * Implements a page that renders the help content for the app.
  16. */
  17. class HelpView extends PureComponent<Props> {
  18. /**
  19. * Implements {@code PureComponent#render()}.
  20. *
  21. * @inheritdoc
  22. * @returns {ReactElement}
  23. */
  24. render() {
  25. return (
  26. <JitsiModal
  27. headerProps = {{
  28. headerLabelKey: 'helpView.header'
  29. }}
  30. modalId = { HELP_VIEW_MODAL_ID }>
  31. <WebView source = {{ uri: this.props._url }} />
  32. </JitsiModal>
  33. );
  34. }
  35. }
  36. /**
  37. * Maps part of the Redux state to the props of this component.
  38. *
  39. * @param {Object} state - The Redux state.
  40. * @returns {Props}
  41. */
  42. function _mapStateToProps(state) {
  43. return {
  44. _url: state['features/base/config'].helpCentreURL || DEFAULT_HELP_CENTRE_URL
  45. };
  46. }
  47. export default connect(_mapStateToProps)(HelpView);