snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
45
react/features/base/dialog/functions.ts
Normal file
45
react/features/base/dialog/functions.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { ComponentType } from 'react';
|
||||
|
||||
import { IReduxState } from '../../app/types';
|
||||
import { IStateful } from '../app/types';
|
||||
import ColorSchemeRegistry from '../color-scheme/ColorSchemeRegistry';
|
||||
import { toState } from '../redux/functions';
|
||||
|
||||
/**
|
||||
* Checks if any {@code Dialog} is currently open.
|
||||
*
|
||||
* @param {IStateful} stateful - The redux store, the redux
|
||||
* {@code getState} function, or the redux state itself.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function isAnyDialogOpen(stateful: IStateful) {
|
||||
return Boolean(toState(stateful)['features/base/dialog'].component);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a {@code Dialog} with a specific {@code component} is currently
|
||||
* open.
|
||||
*
|
||||
* @param {IStateful} stateful - The redux store, the redux
|
||||
* {@code getState} function, or the redux state itself.
|
||||
* @param {React.Component} component - The {@code component} of a
|
||||
* {@code Dialog} to be checked.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function isDialogOpen(stateful: IStateful, component: ComponentType<any>) {
|
||||
return toState(stateful)['features/base/dialog'].component === component;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps part of the Redux state to the props of any Dialog based component.
|
||||
*
|
||||
* @param {IReduxState} state - The Redux state.
|
||||
* @returns {{
|
||||
* _dialogStyles: StyleType
|
||||
* }}
|
||||
*/
|
||||
export function _abstractMapStateToProps(state: IReduxState) {
|
||||
return {
|
||||
_dialogStyles: ColorSchemeRegistry.get(state, 'Dialog')
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user