snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
97
react/features/prejoin/components/web/PrejoinApp.tsx
Normal file
97
react/features/prejoin/components/web/PrejoinApp.tsx
Normal file
@@ -0,0 +1,97 @@
|
||||
import React, { ComponentType } from 'react';
|
||||
|
||||
import BaseApp from '../../../base/app/components/BaseApp';
|
||||
import { setConfig } from '../../../base/config/actions';
|
||||
import { createPrejoinTracks } from '../../../base/tracks/functions.web';
|
||||
import GlobalStyles from '../../../base/ui/components/GlobalStyles.web';
|
||||
import JitsiThemeProvider from '../../../base/ui/components/JitsiThemeProvider.web';
|
||||
import DialogContainer from '../../../base/ui/components/web/DialogContainer';
|
||||
import { setupInitialDevices } from '../../../conference/actions.web';
|
||||
import { initPrejoin } from '../../functions.web';
|
||||
|
||||
import PrejoinThirdParty from './PrejoinThirdParty';
|
||||
|
||||
type Props = {
|
||||
|
||||
/**
|
||||
* Indicates the style type that needs to be applied.
|
||||
*/
|
||||
styleType: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Wrapper application for prejoin.
|
||||
*
|
||||
* @augments BaseApp
|
||||
*/
|
||||
export default class PrejoinApp extends BaseApp<Props> {
|
||||
|
||||
/**
|
||||
* Navigates to {@link Prejoin} upon mount.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
override async componentDidMount() {
|
||||
await super.componentDidMount();
|
||||
|
||||
const { store } = this.state;
|
||||
const { dispatch } = store ?? {};
|
||||
const { styleType } = this.props;
|
||||
|
||||
super._navigate({
|
||||
component: PrejoinThirdParty,
|
||||
props: {
|
||||
className: styleType
|
||||
}
|
||||
});
|
||||
|
||||
const { startWithAudioMuted, startWithVideoMuted } = store
|
||||
? store.getState()['features/base/settings']
|
||||
: { startWithAudioMuted: undefined,
|
||||
startWithVideoMuted: undefined };
|
||||
|
||||
dispatch?.(setConfig({
|
||||
prejoinConfig: {
|
||||
enabled: true,
|
||||
showHangUp: false
|
||||
},
|
||||
startWithAudioMuted,
|
||||
startWithVideoMuted
|
||||
}));
|
||||
|
||||
await dispatch?.(setupInitialDevices());
|
||||
const { tryCreateLocalTracks, errors } = createPrejoinTracks();
|
||||
|
||||
const tracks = await tryCreateLocalTracks;
|
||||
|
||||
initPrejoin(tracks, errors, dispatch);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides the parent method to inject {@link AtlasKitThemeProvider} as
|
||||
* the top most component.
|
||||
*
|
||||
* @override
|
||||
*/
|
||||
override _createMainElement(component: ComponentType<any>, props: Object) {
|
||||
return (
|
||||
<JitsiThemeProvider>
|
||||
<GlobalStyles />
|
||||
{ super._createMainElement(component, props) }
|
||||
</JitsiThemeProvider>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the platform specific dialog container.
|
||||
*
|
||||
* @returns {React$Element}
|
||||
*/
|
||||
override _renderDialogContainer() {
|
||||
return (
|
||||
<JitsiThemeProvider>
|
||||
<DialogContainer />
|
||||
</JitsiThemeProvider>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user