mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 03:12:29 +00:00
feat(rnsdk) share bootsrap code with app
This commit is contained in:
committed by
Saúl Ibarra Corretgé
parent
38280c358f
commit
c83c4488bf
@@ -1,10 +1,7 @@
|
||||
/* eslint-disable lines-around-comment, no-undef, no-unused-vars */
|
||||
|
||||
import 'react-native-gesture-handler';
|
||||
// Apply all necessary polyfills as early as possible
|
||||
// to make sure anything imported henceforth sees them.
|
||||
import 'react-native-get-random-values';
|
||||
import './react/features/mobile/polyfills';
|
||||
// NB: This import must always come first.
|
||||
import './react/bootstrap.native';
|
||||
|
||||
import React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
||||
import { View, ViewStyle } from 'react-native';
|
||||
@@ -12,7 +9,6 @@ import { View, ViewStyle } from 'react-native';
|
||||
import { appNavigate } from './react/features/app/actions.native';
|
||||
import { App } from './react/features/app/components/App.native';
|
||||
import { setAudioMuted, setVideoMuted } from './react/features/base/media/actions';
|
||||
import JitsiThemePaperProvider from './react/features/base/ui/components/JitsiThemeProvider.native';
|
||||
|
||||
|
||||
interface IEventListeners {
|
||||
@@ -117,11 +113,9 @@ export const JitsiMeeting = forwardRef((props: IAppProps, ref) => {
|
||||
|
||||
return (
|
||||
<View style = { style as ViewStyle }>
|
||||
<JitsiThemePaperProvider>
|
||||
<App
|
||||
{ ...appProps }
|
||||
ref = { app } />
|
||||
</JitsiThemePaperProvider>
|
||||
<App
|
||||
{ ...appProps }
|
||||
ref = { app } />
|
||||
</View>
|
||||
);
|
||||
});
|
||||
|
||||
7
react/bootstrap.native.js
vendored
Normal file
7
react/bootstrap.native.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
// https://github.com/software-mansion/react-native-gesture-handler/issues/320#issuecomment-443815828
|
||||
import 'react-native-gesture-handler';
|
||||
|
||||
// Apply all necessary polyfills as early as possible to make sure anything imported henceforth
|
||||
// sees them.
|
||||
import 'react-native-get-random-values';
|
||||
import './features/mobile/polyfills';
|
||||
@@ -12,6 +12,7 @@ import { getFeatureFlag } from '../../base/flags/functions';
|
||||
import { clientResized, setSafeAreaInsets } from '../../base/responsive-ui/actions';
|
||||
import DimensionsDetector from '../../base/responsive-ui/components/DimensionsDetector.native';
|
||||
import { updateSettings } from '../../base/settings/actions';
|
||||
import JitsiThemePaperProvider from '../../base/ui/components/JitsiThemeProvider.native';
|
||||
import { _getRouteToRender } from '../getRouteToRender.native';
|
||||
import logger from '../logger';
|
||||
|
||||
@@ -89,6 +90,20 @@ export class App extends AbstractApp<IProps> {
|
||||
logger.info(`Loaded SDK ${AppInfo.sdkVersion}${liteTxt}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements React's {@link Component#render()}.
|
||||
*
|
||||
* @inheritdoc
|
||||
* @returns {ReactElement}
|
||||
*/
|
||||
render() {
|
||||
return (
|
||||
<JitsiThemePaperProvider>
|
||||
{ super.render() }
|
||||
</JitsiThemePaperProvider>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes feature flags and updates settings.
|
||||
*
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
// https://github.com/software-mansion/react-native-gesture-handler/issues/320#issuecomment-443815828
|
||||
import 'react-native-gesture-handler';
|
||||
|
||||
// Apply all necessary polyfills as early as possible to make sure anything imported henceforth
|
||||
// sees them.
|
||||
import 'react-native-get-random-values';
|
||||
import './features/mobile/polyfills';
|
||||
// NB: This import must always come first.
|
||||
import './bootstrap.native';
|
||||
|
||||
import React, { PureComponent } from 'react';
|
||||
import { AppRegistry } from 'react-native';
|
||||
|
||||
import { App } from './features/app/components/App.native';
|
||||
import { _initLogging } from './features/base/logging/functions';
|
||||
import JitsiThemePaperProvider from './features/base/ui/components/JitsiThemeProvider';
|
||||
|
||||
/**
|
||||
* React Native doesn't support specifying props to the main/root component (in
|
||||
@@ -29,10 +23,7 @@ class Root extends PureComponent {
|
||||
*/
|
||||
render() {
|
||||
return (
|
||||
<JitsiThemePaperProvider>
|
||||
<App
|
||||
{ ...this.props } />
|
||||
</JitsiThemePaperProvider>
|
||||
<App { ...this.props } />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user