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

SettingsView.tsx 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801
  1. /* eslint-disable lines-around-comment */
  2. import _ from 'lodash';
  3. import React, { Component } from 'react';
  4. import { WithTranslation } from 'react-i18next';
  5. import {
  6. Alert,
  7. Linking,
  8. NativeModules,
  9. Platform,
  10. ScrollView,
  11. Text,
  12. View
  13. } from 'react-native';
  14. import { Divider } from 'react-native-paper';
  15. import { getDefaultURL } from '../../../app/functions.native';
  16. import { IReduxState } from '../../../app/types';
  17. // @ts-ignore
  18. import { Avatar } from '../../../base/avatar';
  19. import { translate } from '../../../base/i18n/functions';
  20. // @ts-ignore
  21. import JitsiScreen from '../../../base/modal/components/JitsiScreen';
  22. import { getLocalParticipant } from '../../../base/participants/functions';
  23. import { connect } from '../../../base/redux/functions';
  24. import { updateSettings } from '../../../base/settings/actions';
  25. import Button from '../../../base/ui/components/native/Button';
  26. import Input from '../../../base/ui/components/native/Input';
  27. import Switch from '../../../base/ui/components/native/Switch';
  28. // @ts-ignore
  29. import { BUTTON_TYPES } from '../../../base/ui/constants.any';
  30. // @ts-ignore
  31. import { AVATAR_SIZE } from '../../../welcome/components/styles';
  32. import { isServerURLChangeEnabled, normalizeUserInputURL } from '../../functions.native';
  33. // @ts-ignore
  34. import FormRow from './FormRow';
  35. // @ts-ignore
  36. import FormSectionAccordion from './FormSectionAccordion';
  37. // @ts-ignore
  38. import styles from './styles';
  39. /**
  40. * Application information module.
  41. */
  42. const { AppInfo } = NativeModules;
  43. /**
  44. * The URL at which the terms (of service/use) are available to the user.
  45. */
  46. const TERMS_URL = 'https://jitsi.org/meet/terms';
  47. /**
  48. * The URL at which the privacy policy is available to the user.
  49. */
  50. const PRIVACY_URL = 'https://jitsi.org/meet/privacy';
  51. const DEFAULT_HELP_CENTRE_URL = 'https://web-cdn.jitsi.net/faq/meet-faq.html';
  52. interface IState {
  53. /**
  54. * State variable for the disable call integration switch.
  55. */
  56. disableCallIntegration: boolean;
  57. /**
  58. * State variable for the disable crash reporting switch.
  59. */
  60. disableCrashReporting: boolean;
  61. /**
  62. * State variable for the disable p2p switch.
  63. */
  64. disableP2P: boolean;
  65. /**
  66. * Whether the self view is disabled or not.
  67. */
  68. disableSelfView: boolean;
  69. /**
  70. * State variable for the display name field.
  71. */
  72. displayName: string;
  73. /**
  74. * State variable for the email field.
  75. */
  76. email: string;
  77. /**
  78. * State variable for the server URL field.
  79. */
  80. serverURL: string;
  81. /**
  82. * State variable for start car mode.
  83. */
  84. startCarMode: boolean;
  85. /**
  86. * State variable for the start with audio muted switch.
  87. */
  88. startWithAudioMuted: boolean;
  89. /**
  90. * State variable for the start with video muted switch.
  91. */
  92. startWithVideoMuted: boolean;
  93. }
  94. /**
  95. * The type of the React {@code Component} props of
  96. * {@link SettingsView}.
  97. */
  98. interface IProps extends WithTranslation {
  99. /**
  100. * The URL for when the help link.
  101. *
  102. * @protected
  103. */
  104. _helpCentreUrl: string;
  105. /**
  106. * The ID of the local participant.
  107. */
  108. _localParticipantId: string;
  109. /**
  110. * The default URL for when there is no custom URL set in the settings.
  111. *
  112. * @protected
  113. */
  114. _serverURL: string;
  115. /**
  116. * Flag indicating if URL can be changed by user.
  117. *
  118. * @protected
  119. */
  120. _serverURLChangeEnabled: boolean;
  121. /**
  122. * The current settings object.
  123. */
  124. _settings: {
  125. disableCallIntegration: boolean;
  126. disableCrashReporting: boolean;
  127. disableP2P: boolean;
  128. disableSelfView: boolean;
  129. displayName: string;
  130. email: string;
  131. serverURL: string;
  132. startCarMode: boolean;
  133. startWithAudioMuted: boolean;
  134. startWithVideoMuted: boolean;
  135. };
  136. /**
  137. * Whether {@link SettingsView} is visible.
  138. *
  139. * @protected
  140. */
  141. _visible: boolean;
  142. /**
  143. * Add bottom padding to the screen.
  144. */
  145. addBottomInset?: boolean;
  146. /**
  147. * Redux store dispatch function.
  148. */
  149. dispatch: Function;
  150. /**
  151. * Default prop for navigating between screen components(React Navigation).
  152. */
  153. navigation: Object;
  154. /**
  155. * Bounce when scrolling.
  156. */
  157. scrollBounces?: boolean;
  158. }
  159. /**
  160. * The native container rendering the app settings page.
  161. */
  162. class SettingsView extends Component<IProps, IState> {
  163. _urlField: Object;
  164. /**
  165. *
  166. * Initializes a new {@code SettingsView} instance.
  167. *
  168. * @inheritdoc
  169. */
  170. constructor(props: IProps) {
  171. super(props);
  172. const {
  173. disableCallIntegration,
  174. disableCrashReporting,
  175. disableP2P,
  176. disableSelfView,
  177. displayName,
  178. email,
  179. serverURL,
  180. startCarMode,
  181. startWithAudioMuted,
  182. startWithVideoMuted
  183. } = props._settings || {};
  184. this.state = {
  185. disableCallIntegration,
  186. disableCrashReporting,
  187. disableP2P,
  188. disableSelfView,
  189. displayName: displayName || '',
  190. email: email || '',
  191. serverURL: serverURL || '',
  192. startCarMode,
  193. startWithAudioMuted,
  194. startWithVideoMuted
  195. };
  196. // Bind event handlers so they are only bound once per instance.
  197. this._onBlurServerURL = this._onBlurServerURL.bind(this);
  198. this._onChangeDisplayName = this._onChangeDisplayName.bind(this);
  199. this._onChangeEmail = this._onChangeEmail.bind(this);
  200. this._onChangeServerURL = this._onChangeServerURL.bind(this);
  201. this._onClose = this._onClose.bind(this);
  202. this._onDisableCallIntegration = this._onDisableCallIntegration.bind(this);
  203. this._onDisableCrashReporting = this._onDisableCrashReporting.bind(this);
  204. this._onDisableP2P = this._onDisableP2P.bind(this);
  205. this._onDisableSelfView = this._onDisableSelfView.bind(this);
  206. this._onStartAudioMutedChange
  207. = this._onStartAudioMutedChange.bind(this);
  208. this._onStartCarmodeInLowBandwidthMode
  209. = this._onStartCarmodeInLowBandwidthMode.bind(this);
  210. this._onStartVideoMutedChange
  211. = this._onStartVideoMutedChange.bind(this);
  212. this._setURLFieldReference = this._setURLFieldReference.bind(this);
  213. this._onShowHelpPressed = this._onShowHelpPressed.bind(this);
  214. this._onShowPrivacyPressed = this._onShowPrivacyPressed.bind(this);
  215. this._onShowTermsPressed = this._onShowTermsPressed.bind(this);
  216. this._showURLAlert = this._showURLAlert.bind(this);
  217. }
  218. /**
  219. * Updates and syncs settings.
  220. *
  221. * @inheritdoc
  222. * @returns {void}
  223. */
  224. componentDidUpdate(prevProps: IProps) {
  225. const { _settings } = this.props;
  226. if (!_.isEqual(prevProps._settings, _settings)) {
  227. // @ts-ignore
  228. // eslint-disable-next-line react/no-did-update-set-state
  229. this.setState(_settings);
  230. }
  231. }
  232. /**
  233. * Implements React's {@link Component#render()}, renders the settings page.
  234. *
  235. * @inheritdoc
  236. * @returns {ReactElement}
  237. */
  238. render() {
  239. const {
  240. disableCallIntegration,
  241. disableCrashReporting,
  242. disableP2P,
  243. disableSelfView,
  244. displayName,
  245. email,
  246. serverURL,
  247. startCarMode,
  248. startWithAudioMuted,
  249. startWithVideoMuted
  250. } = this.state;
  251. const {
  252. addBottomInset = false,
  253. scrollBounces = false,
  254. t
  255. } = this.props;
  256. return (
  257. <JitsiScreen
  258. disableForcedKeyboardDismiss = { true }
  259. safeAreaInsets = { [ addBottomInset && 'bottom', 'left', 'right' ].filter(Boolean) }
  260. style = { styles.settingsViewContainer }>
  261. <ScrollView bounces = { scrollBounces }>
  262. <View style = { styles.avatarContainer }>
  263. <Avatar
  264. participantId = { this.props._localParticipantId }
  265. size = { AVATAR_SIZE } />
  266. </View>
  267. <FormSectionAccordion
  268. label = 'settingsView.profileSection'>
  269. <Input
  270. // @ts-ignore
  271. customStyles = {{ container: styles.customContainer }}
  272. label = { t('settingsView.displayName') }
  273. onChange = { this._onChangeDisplayName }
  274. placeholder = { t('settingsView.displayNamePlaceholderText') }
  275. textContentType = { 'name' } // iOS only
  276. value = { displayName } />
  277. {/* @ts-ignore */}
  278. <Divider style = { styles.fieldSeparator } />
  279. <Input
  280. // @ts-ignore
  281. autoCapitalize = 'none'
  282. customStyles = {{ container: styles.customContainer }}
  283. keyboardType = { 'email-address' }
  284. label = { t('settingsView.email') }
  285. onChange = { this._onChangeEmail }
  286. placeholder = { t('settingsView.emailPlaceholderText') }
  287. textContentType = { 'emailAddress' } // iOS only
  288. value = { email } />
  289. </FormSectionAccordion>
  290. <FormSectionAccordion
  291. label = 'settingsView.conferenceSection'>
  292. <Input
  293. // @ts-ignore
  294. autoCapitalize = 'none'
  295. customStyles = {{ container: styles.customContainer }}
  296. editable = { this.props._serverURLChangeEnabled }
  297. keyboardType = { 'url' }
  298. label = { t('settingsView.serverURL') }
  299. onBlur = { this._onBlurServerURL }
  300. onChange = { this._onChangeServerURL }
  301. placeholder = { this.props._serverURL }
  302. textContentType = { 'URL' } // iOS only
  303. value = { serverURL } />
  304. {/* @ts-ignore */}
  305. <Divider style = { styles.fieldSeparator } />
  306. <FormRow label = 'settingsView.startCarModeInLowBandwidthMode'>
  307. <Switch
  308. checked = { startCarMode }
  309. // @ts-ignore
  310. onChange = { this._onStartCarmodeInLowBandwidthMode } />
  311. </FormRow>
  312. {/* @ts-ignore */}
  313. <Divider style = { styles.fieldSeparator } />
  314. <FormRow
  315. label = 'settingsView.startWithAudioMuted'>
  316. <Switch
  317. checked = { startWithAudioMuted }
  318. // @ts-ignore
  319. onChange = { this._onStartAudioMutedChange } />
  320. </FormRow>
  321. {/* @ts-ignore */}
  322. <Divider style = { styles.fieldSeparator } />
  323. <FormRow label = 'settingsView.startWithVideoMuted'>
  324. <Switch
  325. checked = { startWithVideoMuted }
  326. // @ts-ignore
  327. onChange = { this._onStartVideoMutedChange } />
  328. </FormRow>
  329. {/* @ts-ignore */}
  330. <Divider style = { styles.fieldSeparator } />
  331. <FormRow label = 'videothumbnail.hideSelfView'>
  332. <Switch
  333. checked = { disableSelfView }
  334. // @ts-ignore
  335. onChange = { this._onDisableSelfView } />
  336. </FormRow>
  337. </FormSectionAccordion>
  338. <FormSectionAccordion
  339. label = 'settingsView.links'>
  340. <Button
  341. accessibilityLabel = 'settingsView.help'
  342. labelKey = 'settingsView.help'
  343. onClick = { this._onShowHelpPressed }
  344. type = { BUTTON_TYPES.TERTIARY } />
  345. {/* @ts-ignore */}
  346. <Divider style = { styles.fieldSeparator } />
  347. <Button
  348. accessibilityLabel = 'settingsView.terms'
  349. labelKey = 'settingsView.terms'
  350. onClick = { this._onShowTermsPressed }
  351. type = { BUTTON_TYPES.TERTIARY } />
  352. {/* @ts-ignore */}
  353. <Divider style = { styles.fieldSeparator } />
  354. <Button
  355. accessibilityLabel = 'settingsView.privacy'
  356. labelKey = 'settingsView.privacy'
  357. onClick = { this._onShowPrivacyPressed }
  358. type = { BUTTON_TYPES.TERTIARY } />
  359. </FormSectionAccordion>
  360. <FormSectionAccordion
  361. label = 'settingsView.buildInfoSection'>
  362. <FormRow
  363. label = 'settingsView.version'>
  364. <Text style = { styles.text }>
  365. {`${AppInfo.version} build ${AppInfo.buildNumber}`}
  366. </Text>
  367. </FormRow>
  368. </FormSectionAccordion>
  369. <FormSectionAccordion
  370. label = 'settingsView.advanced'>
  371. { Platform.OS === 'android' && (
  372. <>
  373. <FormRow
  374. label = 'settingsView.disableCallIntegration'>
  375. <Switch
  376. checked = { disableCallIntegration }
  377. // @ts-ignore
  378. onChange = { this._onDisableCallIntegration } />
  379. </FormRow>
  380. {/* @ts-ignore */}
  381. <Divider style = { styles.fieldSeparator } />
  382. </>
  383. )}
  384. <FormRow
  385. label = 'settingsView.disableP2P'>
  386. <Switch
  387. checked = { disableP2P }
  388. // @ts-ignore
  389. onChange = { this._onDisableP2P } />
  390. </FormRow>
  391. {/* @ts-ignore */}
  392. <Divider style = { styles.fieldSeparator } />
  393. {AppInfo.GOOGLE_SERVICES_ENABLED && (
  394. <FormRow
  395. fieldSeparator = { true }
  396. label = 'settingsView.disableCrashReporting'>
  397. <Switch
  398. checked = { disableCrashReporting }
  399. // @ts-ignore
  400. onChange = { this._onDisableCrashReporting } />
  401. </FormRow>
  402. )}
  403. </FormSectionAccordion>
  404. </ScrollView>
  405. </JitsiScreen>
  406. );
  407. }
  408. /**
  409. * Handler the server URL lose focus event. Here we validate the server URL
  410. * and update it to the normalized version, or show an error if incorrect.
  411. *
  412. * @private
  413. * @returns {void}
  414. */
  415. _onBlurServerURL() {
  416. this._processServerURL(false /* hideOnSuccess */);
  417. }
  418. /**
  419. * Handles the display name field value change.
  420. *
  421. * @param {string} displayName - The value typed in the name field.
  422. * @protected
  423. * @returns {void}
  424. */
  425. _onChangeDisplayName(displayName: string) {
  426. this.setState({
  427. displayName
  428. });
  429. this._updateSettings({
  430. displayName
  431. });
  432. }
  433. /**
  434. * Handles the email field value change.
  435. *
  436. * @param {string} email - The value typed in the email field.
  437. * @protected
  438. * @returns {void}
  439. */
  440. _onChangeEmail(email: string) {
  441. this.setState({
  442. email
  443. });
  444. this._updateSettings({
  445. email
  446. });
  447. }
  448. /**
  449. * Handles the server name field value change.
  450. *
  451. * @param {string} serverURL - The server URL typed in the server field.
  452. * @protected
  453. * @returns {void}
  454. */
  455. _onChangeServerURL(serverURL: string) {
  456. this.setState({
  457. serverURL
  458. });
  459. this._updateSettings({
  460. serverURL
  461. });
  462. }
  463. /**
  464. * Handles the disable call integration change event.
  465. *
  466. * @param {boolean} disableCallIntegration - The new value
  467. * option.
  468. * @private
  469. * @returns {void}
  470. */
  471. _onDisableCallIntegration(disableCallIntegration: boolean) {
  472. this.setState({
  473. disableCallIntegration
  474. });
  475. this._updateSettings({
  476. disableCallIntegration
  477. });
  478. }
  479. /**
  480. * Handles the disable P2P change event.
  481. *
  482. * @param {boolean} disableP2P - The new value
  483. * option.
  484. * @private
  485. * @returns {void}
  486. */
  487. _onDisableP2P(disableP2P: boolean) {
  488. this.setState({
  489. disableP2P
  490. });
  491. this._updateSettings({
  492. disableP2P
  493. });
  494. }
  495. /** .
  496. * Handles the disable self view change event.
  497. *
  498. * @param {boolean} disableSelfView - The new value.
  499. * @private
  500. * @returns {void}
  501. */
  502. _onDisableSelfView(disableSelfView: boolean) {
  503. this.setState({
  504. disableSelfView
  505. });
  506. this._updateSettings({
  507. disableSelfView
  508. });
  509. }
  510. /** .
  511. * Handles car mode in low bandwidth mode.
  512. *
  513. * @param {boolean} startCarMode - The new value.
  514. * @private
  515. * @returns {void}
  516. */
  517. _onStartCarmodeInLowBandwidthMode(startCarMode: boolean) {
  518. this.setState({
  519. startCarMode
  520. });
  521. this._updateSettings({
  522. startCarMode
  523. });
  524. }
  525. /**
  526. * Handles the disable crash reporting change event.
  527. *
  528. * @param {boolean} disableCrashReporting - The new value
  529. * option.
  530. * @private
  531. * @returns {void}
  532. */
  533. _onDisableCrashReporting(disableCrashReporting: boolean) {
  534. if (disableCrashReporting) {
  535. this._showCrashReportingDisableAlert();
  536. } else {
  537. this._disableCrashReporting(disableCrashReporting);
  538. }
  539. }
  540. /**
  541. * Callback to be invoked on closing the modal. Also invokes normalizeUserInputURL to validate
  542. * the URL entered by the user.
  543. *
  544. * @returns {boolean} - True if the modal can be closed.
  545. */
  546. _onClose() {
  547. return this._processServerURL(true /* hideOnSuccess */);
  548. }
  549. /**
  550. * Handles the start audio muted change event.
  551. *
  552. * @param {boolean} startWithAudioMuted - The new value for the start audio muted
  553. * option.
  554. * @protected
  555. * @returns {void}
  556. */
  557. _onStartAudioMutedChange(startWithAudioMuted: boolean) {
  558. this.setState({
  559. startWithAudioMuted
  560. });
  561. this._updateSettings({
  562. startWithAudioMuted
  563. });
  564. }
  565. /**
  566. * Handles the start video muted change event.
  567. *
  568. * @param {boolean} startWithVideoMuted - The new value for the start video muted
  569. * option.
  570. * @protected
  571. * @returns {void}
  572. */
  573. _onStartVideoMutedChange(startWithVideoMuted: boolean) {
  574. this.setState({
  575. startWithVideoMuted
  576. });
  577. this._updateSettings({
  578. startWithVideoMuted
  579. });
  580. }
  581. /**
  582. * Processes the server URL. It normalizes it and an error alert is
  583. * displayed in case it's incorrect.
  584. *
  585. * @param {boolean} hideOnSuccess - True if the dialog should be hidden if
  586. * normalization / validation succeeds, false otherwise.
  587. * @private
  588. * @returns {void}
  589. */
  590. _processServerURL(hideOnSuccess: boolean) {
  591. // @ts-ignore
  592. const { serverURL } = this.props._settings;
  593. const normalizedURL = normalizeUserInputURL(serverURL);
  594. if (normalizedURL === null) {
  595. this._showURLAlert();
  596. return false;
  597. }
  598. this._onChangeServerURL(normalizedURL);
  599. return hideOnSuccess;
  600. }
  601. /**
  602. * Stores a reference to the URL field for later use.
  603. *
  604. * @param {Object} component - The field component.
  605. * @protected
  606. * @returns {void}
  607. */
  608. _setURLFieldReference(component: object) {
  609. this._urlField = component;
  610. }
  611. /**
  612. * Shows an alert telling the user that the URL he/she entered was invalid.
  613. *
  614. * @returns {void}
  615. */
  616. _showURLAlert() {
  617. const { t } = this.props;
  618. Alert.alert(
  619. t('settingsView.alertTitle'),
  620. t('settingsView.alertURLText'),
  621. [
  622. {
  623. // @ts-ignore
  624. onPress: () => this._urlField.focus(),
  625. text: t('settingsView.alertOk')
  626. }
  627. ]
  628. );
  629. }
  630. /**
  631. * Opens the help url into the browser.
  632. *
  633. * @returns {void}
  634. */
  635. _onShowHelpPressed() {
  636. Linking.openURL(this.props._helpCentreUrl);
  637. }
  638. /**
  639. * Opens the privacy url into the browser.
  640. *
  641. * @returns {void}
  642. */
  643. _onShowPrivacyPressed() {
  644. Linking.openURL(PRIVACY_URL);
  645. }
  646. /**
  647. * Opens the terms url into the browser.
  648. *
  649. * @returns {void}
  650. */
  651. _onShowTermsPressed() {
  652. Linking.openURL(TERMS_URL);
  653. }
  654. /**
  655. * Shows an alert warning the user about disabling crash reporting.
  656. *
  657. * @returns {void}
  658. */
  659. _showCrashReportingDisableAlert() {
  660. const { t } = this.props;
  661. Alert.alert(
  662. t('settingsView.alertTitle'),
  663. t('settingsView.disableCrashReportingWarning'),
  664. [
  665. {
  666. onPress: () => this._disableCrashReporting(true),
  667. text: t('settingsView.alertOk')
  668. },
  669. {
  670. text: t('settingsView.alertCancel')
  671. }
  672. ]
  673. );
  674. }
  675. /**
  676. * Updates the settings and sets state for disableCrashReporting.
  677. *
  678. * @param {boolean} disableCrashReporting - Whether crash reporting is disabled or not.
  679. * @returns {void}
  680. */
  681. _disableCrashReporting(disableCrashReporting: boolean) {
  682. this.setState({
  683. disableCrashReporting
  684. });
  685. this._updateSettings({
  686. disableCrashReporting
  687. });
  688. }
  689. /**
  690. * Updates the persisted settings on any change.
  691. *
  692. * @param {Object} updateObject - The partial update object for the
  693. * settings.
  694. * @private
  695. * @returns {void}
  696. */
  697. _updateSettings(updateObject: Object) {
  698. const { dispatch } = this.props;
  699. dispatch(updateSettings(updateObject));
  700. }
  701. }
  702. /**
  703. * Maps part of the Redux state to the props of this component.
  704. *
  705. * @param {Object} state - The Redux state.
  706. * @returns {IProps}
  707. */
  708. function _mapStateToProps(state: IReduxState) {
  709. const localParticipant = getLocalParticipant(state);
  710. return {
  711. _helpCentreUrl: state['features/base/config'].helpCentreURL || DEFAULT_HELP_CENTRE_URL,
  712. _localParticipantId: localParticipant?.id,
  713. _serverURL: getDefaultURL(state),
  714. _serverURLChangeEnabled: isServerURLChangeEnabled(state),
  715. _settings: state['features/base/settings'],
  716. _visible: state['features/settings'].visible
  717. };
  718. }
  719. export default translate(connect(_mapStateToProps)(SettingsView));