Replace hotkey scopes by focus stack (Part 6 - Remove Hotkey scopes 🫳🎤) (#13127)
# Replace hotkey scopes by focus stack (Part 6 - Remove Hotkey scopes) This PR is the last part of a refactoring aiming to deprecate the hotkey scopes api in favor of the new focus stack api which is more robust. Part 1: https://github.com/twentyhq/twenty/pull/12673 Part 2: https://github.com/twentyhq/twenty/pull/12798 Part 3: https://github.com/twentyhq/twenty/pull/12910 Part 4: https://github.com/twentyhq/twenty/pull/12933 Part 5: https://github.com/twentyhq/twenty/pull/13106 In this part, we completely remove the hotkey scopes.
This commit is contained in:
+3
-5
@@ -18,7 +18,6 @@ type NavigationDrawerInputProps = {
|
||||
onSubmit: (value: string) => void;
|
||||
onCancel: (value: string) => void;
|
||||
onClickOutside: (event: MouseEvent | TouchEvent, value: string) => void;
|
||||
hotkeyScope: string;
|
||||
};
|
||||
|
||||
const NAVIGATION_DRAWER_INPUT_FOCUS_ID = 'navigation-drawer-input';
|
||||
@@ -32,7 +31,6 @@ export const NavigationDrawerInput = ({
|
||||
onSubmit,
|
||||
onCancel,
|
||||
onClickOutside,
|
||||
hotkeyScope,
|
||||
}: NavigationDrawerInputProps) => {
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
@@ -45,7 +43,6 @@ export const NavigationDrawerInput = ({
|
||||
});
|
||||
},
|
||||
focusId: NAVIGATION_DRAWER_INPUT_FOCUS_ID,
|
||||
scope: hotkeyScope,
|
||||
});
|
||||
|
||||
useHotkeysOnFocusedElement({
|
||||
@@ -57,7 +54,6 @@ export const NavigationDrawerInput = ({
|
||||
});
|
||||
},
|
||||
focusId: NAVIGATION_DRAWER_INPUT_FOCUS_ID,
|
||||
scope: hotkeyScope,
|
||||
});
|
||||
|
||||
useListenClickOutside({
|
||||
@@ -86,7 +82,9 @@ export const NavigationDrawerInput = ({
|
||||
type: FocusComponentType.TEXT_INPUT,
|
||||
instanceId: NAVIGATION_DRAWER_INPUT_FOCUS_ID,
|
||||
},
|
||||
hotkeyScope: { scope: hotkeyScope },
|
||||
globalHotkeysConfig: {
|
||||
enableGlobalHotkeysConflictingWithKeyboard: false,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
export enum NavigationDrawerHotKeyScope {
|
||||
MultiWorkspaceDropdownButton = 'multi-workspace-dropdown',
|
||||
}
|
||||
Reference in New Issue
Block a user