feat: quick add (#2240)

* feat: quick add

* style: made text color muted
This commit is contained in:
Dakshesh Jain 2023-09-22 15:31:54 +05:30 committed by GitHub
parent daa0b16960
commit 771ca585db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 847 additions and 99 deletions

View file

@ -36,6 +36,7 @@ const useGanttChartIssues = (workspaceSlug: string | undefined, projectId: strin
return {
ganttIssues,
mutateGanttIssues,
params,
};
};

View file

@ -0,0 +1,19 @@
import { useEffect } from "react";
const useKeypress = (key: string, callback: () => void) => {
useEffect(() => {
const handleKeydown = (event: KeyboardEvent) => {
if (event.key === key) {
callback();
}
};
document.addEventListener("keydown", handleKeydown);
return () => {
document.removeEventListener("keydown", handleKeydown);
};
});
};
export default useKeypress;