2294 feat(frontend): styling shortcut keys (#2336)
* 2294 feat(frontend): styling shortcut keys * 2294 fix(front): pr requested changes * Fix component interface --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -88,13 +88,9 @@ export const CommandMenu = () => {
|
||||
const activities = activityData?.searchResults ?? [];
|
||||
|
||||
const checkInShortcuts = (cmd: Command, search: string) => {
|
||||
if (cmd.shortcuts && cmd.shortcuts.length > 0) {
|
||||
return cmd.shortcuts
|
||||
.join('')
|
||||
.toLowerCase()
|
||||
.includes(search.toLowerCase());
|
||||
}
|
||||
return false;
|
||||
return (cmd.firstHotKey + (cmd.secondHotKey ?? ''))
|
||||
.toLowerCase()
|
||||
.includes(search.toLowerCase());
|
||||
};
|
||||
|
||||
const checkInLabels = (cmd: Command, search: string) => {
|
||||
@ -144,7 +140,8 @@ export const CommandMenu = () => {
|
||||
Icon={cmd.Icon}
|
||||
label={cmd.label}
|
||||
onClick={cmd.onCommandClick}
|
||||
shortcuts={cmd.shortcuts || []}
|
||||
firstHotKey={cmd.firstHotKey}
|
||||
secondHotKey={cmd.secondHotKey}
|
||||
/>
|
||||
))}
|
||||
</CommandGroup>
|
||||
@ -156,7 +153,8 @@ export const CommandMenu = () => {
|
||||
label={cmd.label}
|
||||
Icon={cmd.Icon}
|
||||
onClick={cmd.onCommandClick}
|
||||
shortcuts={cmd.shortcuts || []}
|
||||
firstHotKey={cmd.firstHotKey}
|
||||
secondHotKey={cmd.secondHotKey}
|
||||
/>
|
||||
))}
|
||||
</CommandGroup>
|
||||
|
||||
Reference in New Issue
Block a user