snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
25
react/features/keyboard-shortcuts/hooks.ts
Normal file
25
react/features/keyboard-shortcuts/hooks.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { useSelector } from 'react-redux';
|
||||
|
||||
import { isMobileBrowser } from '../base/environment/utils';
|
||||
|
||||
import KeyboardShortcutsButton from './components/KeyboardShortcutsButton';
|
||||
import { areKeyboardShortcutsEnabled } from './functions';
|
||||
|
||||
const shortcuts = {
|
||||
key: 'shortcuts',
|
||||
Content: KeyboardShortcutsButton,
|
||||
group: 4
|
||||
};
|
||||
|
||||
/**
|
||||
* A hook that returns the keyboard shortcuts button if it is enabled and undefined otherwise.
|
||||
*
|
||||
* @returns {Object | undefined}
|
||||
*/
|
||||
export function useKeyboardShortcutsButton() {
|
||||
const _areKeyboardShortcutsEnabled = useSelector(areKeyboardShortcutsEnabled);
|
||||
|
||||
if (!isMobileBrowser() && _areKeyboardShortcutsEnabled) {
|
||||
return shortcuts;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user