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.

DialInInfoApp.web.tsx 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import React from 'react';
  2. import ReactDOM from 'react-dom';
  3. import { I18nextProvider } from 'react-i18next';
  4. import { isMobileBrowser } from '../../../base/environment/utils';
  5. import i18next from '../../../base/i18n/i18next';
  6. import { parseURLParams } from '../../../base/util/parseURLParams';
  7. import { DIAL_IN_INFO_PAGE_PATH_NAME } from '../../constants';
  8. import DialInSummary from '../dial-in-summary/web/DialInSummary';
  9. import NoRoomError from './NoRoomError.web';
  10. /**
  11. * TODO: This seems unused, so we can drop it.
  12. */
  13. document.addEventListener('DOMContentLoaded', () => {
  14. // @ts-ignore
  15. const { room } = parseURLParams(window.location, true, 'search');
  16. const { href } = window.location;
  17. const ix = href.indexOf(DIAL_IN_INFO_PAGE_PATH_NAME);
  18. const url = (ix > 0 ? href.substring(0, ix) : href) + room;
  19. /* eslint-disable-next-line react/no-deprecated */
  20. ReactDOM.render(
  21. <I18nextProvider i18n = { i18next }>
  22. { room
  23. ? <DialInSummary
  24. className = 'dial-in-page'
  25. clickableNumbers = { isMobileBrowser() }
  26. room = { decodeURIComponent(room) }
  27. url = { url } />
  28. : <NoRoomError className = 'dial-in-page' /> }
  29. </I18nextProvider>,
  30. document.getElementById('react')
  31. );
  32. });
  33. window.addEventListener('beforeunload', () => {
  34. /* eslint-disable-next-line react/no-deprecated */
  35. ReactDOM.unmountComponentAtNode(document.getElementById('react')!);
  36. });