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

1234567891011121314151617181920212223242526272829303132333435
  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';
  6. import { parseURLParams } from '../../../base/util/parseURLParams';
  7. import { DIAL_IN_INFO_PAGE_PATH_NAME } from '../../constants';
  8. import { DialInSummary } from '../dial-in-summary';
  9. import NoRoomError from './NoRoomError';
  10. document.addEventListener('DOMContentLoaded', () => {
  11. const { room } = parseURLParams(window.location, true, 'search');
  12. const { href } = window.location;
  13. const ix = href.indexOf(DIAL_IN_INFO_PAGE_PATH_NAME);
  14. const url = (ix > 0 ? href.substring(0, ix) : href) + room;
  15. ReactDOM.render(
  16. <I18nextProvider i18n = { i18next }>
  17. { room
  18. ? <DialInSummary
  19. className = 'dial-in-page'
  20. clickableNumbers = { isMobileBrowser() }
  21. room = { decodeURIComponent(room) }
  22. url = { url } />
  23. : <NoRoomError className = 'dial-in-page' /> }
  24. </I18nextProvider>,
  25. document.getElementById('react')
  26. );
  27. });
  28. window.addEventListener('beforeunload', () => {
  29. ReactDOM.unmountComponentAtNode(document.getElementById('react'));
  30. });