From 7388f2bcff67dd0f9cd2dc2345e20030ebe1ef85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Bosi?= <71827178+bosiraphael@users.noreply.github.com> Date: Mon, 30 Dec 2024 18:10:58 +0100 Subject: [PATCH] Fix command menu action click (#9285) - Fix typing - Fix onClick --- .../src/modules/command-menu/components/CommandMenu.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/twenty-front/src/modules/command-menu/components/CommandMenu.tsx b/packages/twenty-front/src/modules/command-menu/components/CommandMenu.tsx index c0cf3815d..66b152f46 100644 --- a/packages/twenty-front/src/modules/command-menu/components/CommandMenu.tsx +++ b/packages/twenty-front/src/modules/command-menu/components/CommandMenu.tsx @@ -8,6 +8,7 @@ import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu'; import { useCommandMenuHotKeys } from '@/command-menu/hooks/useCommandMenuHotKeys'; import { useMatchingCommandMenuCommands } from '@/command-menu/hooks/useMatchingCommandMenuCommands'; import { commandMenuSearchState } from '@/command-menu/states/commandMenuSearchState'; +import { Command } from '@/command-menu/types/Command'; import { SelectableItem } from '@/ui/layout/selectable-list/components/SelectableItem'; import { SelectableList } from '@/ui/layout/selectable-list/components/SelectableList'; import { AppHotkeyScope } from '@/ui/utilities/hotkey/types/AppHotkeyScope'; @@ -23,7 +24,7 @@ const MOBILE_NAVIGATION_BAR_HEIGHT = 64; type CommandGroupConfig = { heading: string; - items?: any[]; + items?: Command[]; }; const StyledCommandMenu = styled.div` @@ -233,7 +234,7 @@ export const CommandMenu = () => { Icon={item.Icon} label={item.label} to={item.to} - onClick={item.onClick} + onClick={item.onCommandClick} firstHotKey={item.firstHotKey} secondHotKey={item.secondHotKey} shouldCloseCommandMenuOnClick={