2022-07-28 07:28:29 +00:00
|
|
|
/* eslint-disable lines-around-comment */
|
2021-11-11 14:32:56 +00:00
|
|
|
|
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
|
2022-10-20 09:11:27 +00:00
|
|
|
import { IReduxState } from '../../../app/types';
|
2022-07-28 07:28:29 +00:00
|
|
|
// @ts-ignore
|
2022-01-25 12:55:57 +00:00
|
|
|
import JitsiScreenWebView from '../../../base/modal/components/JitsiScreenWebView';
|
2022-09-05 11:24:13 +00:00
|
|
|
import { connect } from '../../../base/redux/functions';
|
2022-07-28 07:28:29 +00:00
|
|
|
// @ts-ignore
|
2022-01-25 12:55:57 +00:00
|
|
|
import { renderArrowBackButton }
|
2022-07-28 07:28:29 +00:00
|
|
|
// @ts-ignore
|
2022-01-25 12:55:57 +00:00
|
|
|
from '../../../mobile/navigation/components/welcome/functions';
|
2022-07-28 07:28:29 +00:00
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
import styles from './styles';
|
2021-11-11 14:32:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
const DEFAULT_HELP_CENTRE_URL = 'https://web-cdn.jitsi.net/faq/meet-faq.html';
|
|
|
|
|
2022-11-03 08:35:51 +00:00
|
|
|
interface IProps {
|
2021-11-11 14:32:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The URL to display in the Help Centre.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
_url: string;
|
2021-11-11 14:32:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Default prop for navigating between screen components(React Navigation).
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
navigation: Object;
|
2022-11-03 08:35:51 +00:00
|
|
|
}
|
2021-11-11 14:32:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements a page that renders the help content for the app.
|
|
|
|
*/
|
2022-11-03 08:35:51 +00:00
|
|
|
class HelpView extends PureComponent<IProps> {
|
2021-11-11 14:32:56 +00:00
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#componentDidMount()}. Invoked
|
|
|
|
* immediately after mounting occurs.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
componentDidMount() {
|
|
|
|
const {
|
|
|
|
navigation
|
|
|
|
} = this.props;
|
|
|
|
|
2022-07-28 07:28:29 +00:00
|
|
|
// @ts-ignore
|
2021-11-11 14:32:56 +00:00
|
|
|
navigation.setOptions({
|
|
|
|
headerLeft: () =>
|
|
|
|
renderArrowBackButton(() =>
|
2022-07-28 07:28:29 +00:00
|
|
|
// @ts-ignore
|
|
|
|
navigation.goBack())
|
2021-11-11 14:32:56 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements {@code PureComponent#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
return (
|
2022-11-11 15:15:54 +00:00
|
|
|
<JitsiScreenWebView
|
|
|
|
source = { this.props._url }
|
|
|
|
style = { styles.screenContainer } />
|
2021-11-11 14:32:56 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps part of the Redux state to the props of this component.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The Redux state.
|
2022-11-03 08:35:51 +00:00
|
|
|
* @returns {IProps}
|
2021-11-11 14:32:56 +00:00
|
|
|
*/
|
2022-10-20 09:11:27 +00:00
|
|
|
function _mapStateToProps(state: IReduxState) {
|
2021-11-11 14:32:56 +00:00
|
|
|
return {
|
|
|
|
_url: state['features/base/config'].helpCentreURL || DEFAULT_HELP_CENTRE_URL
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(_mapStateToProps)(HelpView);
|