diff --git a/apps/app/components/command-palette/shortcuts-modal.tsx b/apps/app/components/command-palette/shortcuts-modal.tsx index c1800ab17aa..593c6832438 100644 --- a/apps/app/components/command-palette/shortcuts-modal.tsx +++ b/apps/app/components/command-palette/shortcuts-modal.tsx @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import React, { useEffect, useState } from "react"; // headless ui import { Dialog, Transition } from "@headlessui/react"; // icons @@ -15,7 +15,7 @@ const shortcuts = [ { title: "Navigation", shortcuts: [ - { keys: "Ctrl,Cmd,K", description: "To open navigator" }, + { keys: "Ctrl,/,Cmd,K", description: "To open navigator" }, { keys: "↑", description: "Move up" }, { keys: "↓", description: "Move down" }, { keys: "←", description: "Move left" }, @@ -34,22 +34,26 @@ const shortcuts = [ { keys: "Delete", description: "To bulk delete issues" }, { keys: "H", description: "To open shortcuts guide" }, { - keys: "Ctrl,Cmd,Alt,C", + keys: "Ctrl,/,Cmd,Alt,C", description: "To copy issue url when on issue detail page.", }, ], }, ]; +const allShortcuts = shortcuts.map((i) => i.shortcuts).flat(1); + export const ShortcutsModal: React.FC = ({ isOpen, setIsOpen }) => { const [query, setQuery] = useState(""); - const filteredShortcuts = shortcuts.filter((shortcut) => - shortcut.shortcuts.some((item) => item.description.includes(query.trim())) || query === "" - ? true - : false + const filteredShortcuts = allShortcuts.filter((shortcut) => + shortcut.description.includes(query.trim()) || query === "" ? true : false ); + useEffect(() => { + if (!isOpen) setQuery(""); + }, [isOpen]); + return ( @@ -104,8 +108,40 @@ export const ShortcutsModal: React.FC = ({ isOpen, setIsOpen }) => { />
- {filteredShortcuts.length > 0 ? ( - filteredShortcuts.map(({ title, shortcuts }) => ( + {query.trim().length > 0 ? ( + filteredShortcuts.length > 0 ? ( + filteredShortcuts.map((shortcut) => ( +
+
+
+

{shortcut.description}

+
+ {shortcut.keys.split(",").map((key, index) => ( + + + {key} + + + ))} +
+
+
+
+ )) + ) : ( +
+

+ No shortcuts found for{" "} + + {`"`} + {query} + {`"`} + +

+
+ ) + ) : ( + shortcuts.map(({ title, shortcuts }) => (

{title}

@@ -126,17 +162,6 @@ export const ShortcutsModal: React.FC = ({ isOpen, setIsOpen }) => {
)) - ) : ( -
-

- No shortcuts found for{" "} - - {`"`} - {query} - {`"`} - -

-
)}
diff --git a/apps/app/components/workspace/help-section.tsx b/apps/app/components/workspace/help-section.tsx index cd6fce3c642..b8ac07e24aa 100644 --- a/apps/app/components/workspace/help-section.tsx +++ b/apps/app/components/workspace/help-section.tsx @@ -32,7 +32,7 @@ const helpOptions = [ Icon: GithubIcon, }, { - name: "Chat with us", + name: "Email us", href: "mailto:hello@plane.so", Icon: CommentIcon, },