refactor: replace keyboard events with command palette store (#2688)

This commit is contained in:
Aaryan Khandelwal 2023-11-08 13:51:55 +05:30 committed by GitHub
parent 53e7da08e4
commit 5a84ed279d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 219 additions and 344 deletions

View file

@ -26,7 +26,7 @@ export const CycleEmptyState: React.FC<Props> = observer((props) => {
// states
const [cycleIssuesListModal, setCycleIssuesListModal] = useState(false);
const { cycleIssue: cycleIssueStore } = useMobxStore();
const { cycleIssue: cycleIssueStore, commandPalette: commandPaletteStore } = useMobxStore();
const { setToastAlert } = useToast();
@ -62,12 +62,7 @@ export const CycleEmptyState: React.FC<Props> = observer((props) => {
primaryButton={{
text: "New issue",
icon: <PlusIcon className="h-3 w-3" strokeWidth={2} />,
onClick: () => {
const e = new KeyboardEvent("keydown", {
key: "c",
});
document.dispatchEvent(e);
},
onClick: () => commandPaletteStore.toggleCreateIssueModal(true),
}}
secondaryButton={
<Button