diff --git a/apps/app/components/command-palette/index.tsx b/apps/app/components/command-palette/index.tsx index 865bca82d..441fb31fa 100644 --- a/apps/app/components/command-palette/index.tsx +++ b/apps/app/components/command-palette/index.tsx @@ -102,50 +102,54 @@ const CommandPalette: React.FC = () => { !(e.target instanceof HTMLInputElement) && !(e.target as Element).classList?.contains("remirror-editor") ) { - if ((e.ctrlKey || e.metaKey) && e.key === "k") { + if ((e.ctrlKey || e.metaKey) && (e.key === "k" || e.key === "K")) { e.preventDefault(); setIsPaletteOpen(true); - } else if (e.ctrlKey && e.key === "c") { - console.log("Text copied"); - } else if (e.key === "c") { + } else if (e.ctrlKey && (e.key === "c" || e.key === "C")) { + if (e.altKey) { + e.preventDefault(); + if (!router.query.issueId) return; + + const url = new URL(window.location.href); + console.log(url); + copyTextToClipboard(url.href) + .then(() => { + setToastAlert({ + type: "success", + title: "Copied to clipboard", + }); + }) + .catch(() => { + setToastAlert({ + type: "error", + title: "Some error occurred", + }); + }); + console.log("URL Copied"); + } else { + console.log("Text copied"); + } + } else if (e.key === "c" || e.key === "C") { e.preventDefault(); setIsIssueModalOpen(true); - } else if (e.key === "p") { + } else if (e.key === "p" || e.key === "P") { e.preventDefault(); setIsProjectModalOpen(true); - } else if ((e.ctrlKey || e.metaKey) && e.key === "b") { + } else if ((e.ctrlKey || e.metaKey) && (e.key === "b" || e.key === "B")) { e.preventDefault(); toggleCollapsed(); - } else if (e.key === "h") { + } else if (e.key === "h" || e.key === "H") { e.preventDefault(); setIsShortcutsModalOpen(true); - } else if (e.key === "q") { + } else if (e.key === "q" || e.key === "Q") { e.preventDefault(); setIsCreateCycleModalOpen(true); - } else if (e.key === "m") { + } else if (e.key === "m" || e.key === "M") { e.preventDefault(); setIsCreateModuleModalOpen(true); } else if (e.key === "Delete") { e.preventDefault(); setIsBulkDeleteIssuesModalOpen(true); - } else if ((e.ctrlKey || e.metaKey) && e.altKey && e.key === "c") { - e.preventDefault(); - if (!router.query.issueId) return; - - const url = new URL(window.location.href); - copyTextToClipboard(url.href) - .then(() => { - setToastAlert({ - type: "success", - title: "Copied to clipboard", - }); - }) - .catch(() => { - setToastAlert({ - type: "error", - title: "Some error occurred", - }); - }); } } }, diff --git a/apps/app/components/command-palette/shortcuts.tsx b/apps/app/components/command-palette/shortcuts.tsx index d073b7076..f5435055c 100644 --- a/apps/app/components/command-palette/shortcuts.tsx +++ b/apps/app/components/command-palette/shortcuts.tsx @@ -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" }, @@ -27,14 +27,14 @@ const shortcuts = [ { title: "Common", shortcuts: [ - { keys: "p", description: "To create project" }, - { keys: "c", description: "To create issue" }, - { keys: "q", description: "To create cycle" }, - { keys: "m", description: "To create module" }, + { keys: "P", description: "To create project" }, + { keys: "C", description: "To create issue" }, + { keys: "Q", description: "To create cycle" }, + { keys: "M", description: "To create module" }, { keys: "Delete", description: "To bulk delete issues" }, - { keys: "h", description: "To open shortcuts guide" }, + { 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.", }, ], diff --git a/apps/app/components/workspace/help-section.tsx b/apps/app/components/workspace/help-section.tsx index d46bcb276..72c05a496 100644 --- a/apps/app/components/workspace/help-section.tsx +++ b/apps/app/components/workspace/help-section.tsx @@ -57,7 +57,7 @@ export const WorkspaceHelpSection: FC = (props) => { return (
diff --git a/apps/app/layouts/navbar/main-sidebar.tsx b/apps/app/layouts/navbar/main-sidebar.tsx index 0f8d77557..6e4fad82e 100644 --- a/apps/app/layouts/navbar/main-sidebar.tsx +++ b/apps/app/layouts/navbar/main-sidebar.tsx @@ -98,7 +98,7 @@ const Sidebar: React.FC = ({ toggleSidebar, setToggleSidebar }) => {