mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-15 00:07:46 +00:00
* feat(prejoin) created native Prejoin screen * feat(prejoin) fixed useState callback and updates warnings * feat(prejoin) created styles file * feat(prejoin) moved nav from middleware to appNavigate, created native DeviceStatus * feat(prejoin) updated styles * feat(prejoin) review remarks pt. 1 * feat(prejoin) removed unused styles * feat(prejoin) review remarks pt. 2 * feat(prejoin) comment fix * feat(prejoin) added header title * feat(prejoin) review remarks * feat(lobby) updated styles * feat(prejoin) updated lobby screen header button functionality * feat(prejoin) review remarks pt 3 * feat(welcome) removed VideoSwitch component * feat(mobile/navigation) fixed linter * feat(welcome) moved isWelcomePageEnabled to functions.ts * feat(mobile/navigation) screen options and order updates * feat(app) review remark * feat(welcome) added translation for screen header title and fixed build * feat(mobile/navigation) added screen title translation and created screen option * feat(mobile/navigation) fixed screenOptions import * feat(mobile/navigation) added DialInSummary title translation, fixed animation and close button * feat(welcome) fixed build * feat(welcome) removed extra check * feat(prejoin) review remarks pt 4 * feat(prejoin) added Join in low bandwidth mode btn * feat(welcome) changed welcome screen header title * fixup lobby close
49 lines
1.4 KiB
JavaScript
49 lines
1.4 KiB
JavaScript
import React from 'react';
|
|
|
|
import { toState } from '../../base/redux';
|
|
import { isWelcomePageEnabled } from '../../welcome/functions';
|
|
import { _sendReadyToClose } from '../external-api/functions';
|
|
|
|
import { screen } from './routes';
|
|
|
|
export const rootNavigationRef = React.createRef();
|
|
|
|
|
|
/**
|
|
* User defined navigation action included inside the reference to the container.
|
|
*
|
|
* @param {string} name - Destination name of the route that has been defined somewhere.
|
|
* @param {Object} params - Params to pass to the destination route.
|
|
* @returns {Function}
|
|
*/
|
|
export function navigateRoot(name: string, params: Object) {
|
|
return rootNavigationRef.current?.navigate(name, params);
|
|
}
|
|
|
|
/**
|
|
* User defined navigation action included inside the reference to the container.
|
|
*
|
|
* @returns {Function}
|
|
*/
|
|
export function goBack() {
|
|
return rootNavigationRef.current?.goBack();
|
|
}
|
|
|
|
/**
|
|
* Navigates back to Welcome page, if it's available.
|
|
*
|
|
* @param {Object|Function} stateful - Either the whole Redux state object or the Redux store's {@code getState} method.
|
|
* @param {Function} dispatch - Redux dispatch function.
|
|
* @returns {void}
|
|
*/
|
|
export function goBackToRoot(stateful: Function | Object, dispatch: Function) {
|
|
const state = toState(stateful);
|
|
|
|
if (isWelcomePageEnabled(state)) {
|
|
navigateRoot(screen.root);
|
|
} else {
|
|
// For JitsiSDK, WelcomePage is not available
|
|
_sendReadyToClose(dispatch);
|
|
}
|
|
}
|