2018-07-15 14:50:38 +00:00
|
|
|
// @flow
|
|
|
|
|
2018-01-30 20:57:36 +00:00
|
|
|
// FIXME The bundler-related (and the browser-related) polyfills were born at
|
|
|
|
// the very early days of prototyping the execution of lib-jitsi-meet on
|
|
|
|
// react-native. Today, the feature base/lib-jitsi-meet should not be
|
|
|
|
// responsible for such polyfills because it is not the only feature relying on
|
|
|
|
// them. Additionally, the polyfills are usually necessary earlier than the
|
|
|
|
// execution of base/lib-jitsi-meet (which is understandable given that the
|
|
|
|
// polyfills are globals). The remaining problem to be solved here is where to
|
|
|
|
// collect the polyfills' files.
|
|
|
|
import './features/base/lib-jitsi-meet/native/polyfills-bundler';
|
|
|
|
|
2019-01-24 15:53:28 +00:00
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
import { AppRegistry } from 'react-native';
|
2016-10-05 14:36:59 +00:00
|
|
|
|
|
|
|
import { App } from './features/app';
|
2018-07-15 14:50:38 +00:00
|
|
|
import { IncomingCallApp } from './features/mobile/incoming-call';
|
|
|
|
|
2019-05-29 11:58:50 +00:00
|
|
|
declare var __DEV__;
|
|
|
|
|
2018-07-16 16:36:32 +00:00
|
|
|
/**
|
|
|
|
* The type of the React {@code Component} props of {@link Root}.
|
|
|
|
*/
|
2018-07-15 14:50:38 +00:00
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The URL, if any, with which the app was launched.
|
|
|
|
*/
|
|
|
|
url: Object | string
|
|
|
|
};
|
|
|
|
|
2016-10-05 14:36:59 +00:00
|
|
|
/**
|
|
|
|
* React Native doesn't support specifying props to the main/root component (in
|
|
|
|
* the JS/JSX source code). So create a wrapper React Component (class) around
|
|
|
|
* features/app's App instead.
|
|
|
|
*
|
|
|
|
* @extends Component
|
|
|
|
*/
|
2019-01-24 15:53:28 +00:00
|
|
|
class Root extends PureComponent<Props> {
|
2016-10-05 14:36:59 +00:00
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<App
|
2019-01-24 15:53:28 +00:00
|
|
|
{ ...this.props } />
|
2016-10-05 14:36:59 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-29 11:58:50 +00:00
|
|
|
// HORRIBLE HACK ALERT! React Native logs the initial props with `console.log`. Here we are quickly patching it
|
|
|
|
// to avoid logging potentially sensitive information.
|
|
|
|
if (!__DEV__) {
|
|
|
|
/* eslint-disable */
|
|
|
|
|
|
|
|
const __orig_console_log = console.log;
|
|
|
|
const __orig_appregistry_runapplication = AppRegistry.runApplication;
|
|
|
|
|
|
|
|
AppRegistry.runApplication = (...args) => {
|
|
|
|
// $FlowExpectedError
|
|
|
|
console.log = () => {};
|
|
|
|
__orig_appregistry_runapplication(...args);
|
|
|
|
// $FlowExpectedError
|
|
|
|
console.log = __orig_console_log;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* eslint-enable */
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-16 16:36:32 +00:00
|
|
|
// Register the main/root Component of JitsiMeetView.
|
2016-10-05 14:36:59 +00:00
|
|
|
AppRegistry.registerComponent('App', () => Root);
|
2018-07-15 14:50:38 +00:00
|
|
|
|
2018-07-16 16:36:32 +00:00
|
|
|
// Register the main/root Component of IncomingCallView.
|
2018-07-15 14:50:38 +00:00
|
|
|
AppRegistry.registerComponent('IncomingCallApp', () => IncomingCallApp);
|