snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
26
react/features/video-layout/hooks.ts
Normal file
26
react/features/video-layout/hooks.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { useSelector } from 'react-redux';
|
||||
|
||||
import { IReduxState } from '../app/types';
|
||||
import { TILE_VIEW_ENABLED } from '../base/flags/constants';
|
||||
import { getFeatureFlag } from '../base/flags/functions';
|
||||
|
||||
import TileViewButton from './components/TileViewButton';
|
||||
|
||||
const tileview = {
|
||||
key: 'tileview',
|
||||
Content: TileViewButton,
|
||||
group: 2
|
||||
};
|
||||
|
||||
/**
|
||||
* A hook that returns the tile view button if it is enabled and undefined otherwise.
|
||||
*
|
||||
* @returns {Object | undefined}
|
||||
*/
|
||||
export function useTileViewButton() {
|
||||
const tileViewEnabled = useSelector((state: IReduxState) => getFeatureFlag(state, TILE_VIEW_ENABLED, true));
|
||||
|
||||
if (tileViewEnabled) {
|
||||
return tileview;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user