diff --git a/front/src/modules/command-menu/components/CommandMenu.tsx b/front/src/modules/command-menu/components/CommandMenu.tsx index 5a536eca8..da6ce6e32 100644 --- a/front/src/modules/command-menu/components/CommandMenu.tsx +++ b/front/src/modules/command-menu/components/CommandMenu.tsx @@ -77,6 +77,33 @@ export function CommandMenu() { }); const activities = activityData?.searchResults ?? []; + const commands = [ + { + to: '/people', + label: 'Go to People', + shortcuts: ['G', 'P'], + }, + { + to: '/companies', + label: 'Go to Companies', + shortcuts: ['G', 'C'], + }, + { + to: '/opportunities', + label: 'Go to Opportunities', + shortcuts: ['G', 'O'], + }, + { + to: '/settings/profile', + label: 'Go to Settings', + shortcuts: ['G', 'S'], + }, + ]; + + const matchingCommand = commands.find( + (cmd) => cmd.shortcuts.join('') === search?.toUpperCase(), + ); + /* TODO: Allow performing actions on page through CommandBar @@ -132,6 +159,16 @@ export function CommandMenu() { /> No results found. + {matchingCommand && ( + + + + )} {!!people.length && ( {people.map((person) => ( @@ -182,28 +219,22 @@ export function CommandMenu() { ))} )} - - - - - - + {!matchingCommand && ( + + {commands + .filter((cmd) => + cmd.shortcuts?.join('').includes(search?.toUpperCase()), + ) + .map((cmd) => ( + + ))} + + )} );