snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
29
react/features/custom-panel/hooks.web.ts
Normal file
29
react/features/custom-panel/hooks.web.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { useSelector } from 'react-redux';
|
||||
|
||||
import CustomPanelButton from './components/web/CustomPanelButton';
|
||||
import { isCustomPanelEnabled } from './functions';
|
||||
|
||||
/**
|
||||
* Configuration for the custom panel toolbar button.
|
||||
*/
|
||||
const customPanel = {
|
||||
key: 'custom-panel',
|
||||
Content: CustomPanelButton,
|
||||
group: 5
|
||||
};
|
||||
|
||||
/**
|
||||
* A hook that returns the custom panel button if the feature is enabled.
|
||||
* Uses useSelector for reactive updates when the feature is toggled dynamically.
|
||||
*
|
||||
* @returns {Object | undefined} The button configuration or undefined if disabled.
|
||||
*/
|
||||
export function useCustomPanelButton() {
|
||||
const enabled = useSelector(isCustomPanelEnabled);
|
||||
|
||||
if (enabled) {
|
||||
return customPanel;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user