2018-02-13 19:46:47 +00:00
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom';
|
|
|
|
import { I18nextProvider } from 'react-i18next';
|
|
|
|
|
2020-01-29 12:30:17 +00:00
|
|
|
import { isMobileBrowser } from '../../../base/environment/utils';
|
2020-05-20 10:57:03 +00:00
|
|
|
import { i18next } from '../../../base/i18n';
|
2020-05-07 22:26:37 +00:00
|
|
|
import { parseURLParams } from '../../../base/util/parseURLParams';
|
2022-02-28 20:03:42 +00:00
|
|
|
import { DIAL_IN_INFO_PAGE_PATH_NAME } from '../../constants';
|
2018-02-21 01:25:22 +00:00
|
|
|
import { DialInSummary } from '../dial-in-summary';
|
2018-02-13 19:46:47 +00:00
|
|
|
|
2018-03-07 19:30:16 +00:00
|
|
|
import NoRoomError from './NoRoomError';
|
|
|
|
|
2018-02-13 19:46:47 +00:00
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
2018-09-07 22:48:58 +00:00
|
|
|
const { room } = parseURLParams(window.location, true, 'search');
|
2022-02-28 20:03:42 +00:00
|
|
|
const { href } = window.location;
|
|
|
|
const ix = href.indexOf(DIAL_IN_INFO_PAGE_PATH_NAME);
|
|
|
|
const url = (ix > 0 ? href.substring(0, ix) : href) + room;
|
2018-02-13 19:46:47 +00:00
|
|
|
|
|
|
|
ReactDOM.render(
|
|
|
|
<I18nextProvider i18n = { i18next }>
|
2018-03-07 19:30:16 +00:00
|
|
|
{ room
|
|
|
|
? <DialInSummary
|
|
|
|
className = 'dial-in-page'
|
2020-01-29 12:30:17 +00:00
|
|
|
clickableNumbers = { isMobileBrowser() }
|
2022-02-28 20:03:42 +00:00
|
|
|
room = { decodeURIComponent(room) }
|
|
|
|
url = { url } />
|
2018-03-07 19:30:16 +00:00
|
|
|
: <NoRoomError className = 'dial-in-page' /> }
|
2018-02-13 19:46:47 +00:00
|
|
|
</I18nextProvider>,
|
|
|
|
document.getElementById('react')
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
window.addEventListener('beforeunload', () => {
|
|
|
|
ReactDOM.unmountComponentAtNode(document.getElementById('react'));
|
|
|
|
});
|