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.

DialInSummaryApp.tsx 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import React, { ComponentType } from 'react';
  2. import BaseApp from '../../../../base/app/components/BaseApp';
  3. import { isMobileBrowser } from '../../../../base/environment/utils';
  4. import GlobalStyles from '../../../../base/ui/components/GlobalStyles.web';
  5. import JitsiThemeProvider from '../../../../base/ui/components/JitsiThemeProvider.web';
  6. import { parseURLParams } from '../../../../base/util/parseURLParams';
  7. import { DIAL_IN_INFO_PAGE_PATH_NAME } from '../../../constants';
  8. import NoRoomError from '../../dial-in-info-page/NoRoomError.web';
  9. import DialInSummary from './DialInSummary';
  10. /**
  11. * Wrapper application for prejoin.
  12. *
  13. * @augments BaseApp
  14. */
  15. export default class DialInSummaryApp extends BaseApp<any> {
  16. /**
  17. * Navigates to {@link Prejoin} upon mount.
  18. *
  19. * @returns {void}
  20. */
  21. async componentDidMount() {
  22. await super.componentDidMount();
  23. // @ts-ignore
  24. const { room } = parseURLParams(window.location, true, 'search');
  25. const { href } = window.location;
  26. const ix = href.indexOf(DIAL_IN_INFO_PAGE_PATH_NAME);
  27. const url = (ix > 0 ? href.substring(0, ix) : href) + room;
  28. super._navigate({
  29. component: () => (<>
  30. {room
  31. ? <DialInSummary
  32. className = 'dial-in-page'
  33. clickableNumbers = { isMobileBrowser() }
  34. room = { decodeURIComponent(room) }
  35. scrollable = { true }
  36. showTitle = { true }
  37. url = { url } />
  38. : <NoRoomError className = 'dial-in-page' />}
  39. </>)
  40. });
  41. }
  42. /**
  43. * Overrides the parent method to inject {@link AtlasKitThemeProvider} as
  44. * the top most component.
  45. *
  46. * @override
  47. */
  48. _createMainElement(component: ComponentType<any>, props: Object) {
  49. return (
  50. <JitsiThemeProvider>
  51. <GlobalStyles />
  52. {super._createMainElement(component, props)}
  53. </JitsiThemeProvider>
  54. );
  55. }
  56. /**
  57. * Renders the platform specific dialog container.
  58. *
  59. * @returns {React$Element}
  60. */
  61. _renderDialogContainer() {
  62. return null;
  63. }
  64. }