mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-15 06:27:46 +00:00
feat(prejoin) native prejoin screen and other navigation updates
* 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
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
// @flow
|
||||
|
||||
import React from 'react';
|
||||
|
||||
// $FlowExpectedError
|
||||
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.
|
||||
*
|
||||
@@ -13,7 +17,32 @@ export const rootNavigationRef = React.createRef();
|
||||
* @returns {Function}
|
||||
*/
|
||||
export function navigateRoot(name: string, params: Object) {
|
||||
// $FlowExpectedError
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user