feat: shortcuts (#674)

* feat: added shortcut for page and view

* fix: shortcut for view

* fix: onclick method for views and pages
This commit is contained in:
Kunal Vishwakarma 2023-04-03 14:23:50 +05:30 committed by GitHub
parent a18af1cecf
commit 0cf498651c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 3 deletions

View file

@ -167,7 +167,10 @@ const ProjectPages: NextPage<UserAuth> = (props) => {
right={
<PrimaryButton
className="flex items-center gap-2"
onClick={() => setCreateUpdatePageModal(true)}
onClick={() => {
const e = new KeyboardEvent("keydown", { key: "d" });
document.dispatchEvent(e);
}}
>
<PlusIcon className="w-4 h-4" />
Create Page

View file

@ -67,7 +67,14 @@ const ProjectViews: NextPage<UserAuth> = (props) => {
}
right={
<div className="flex items-center gap-2">
<PrimaryButton type="button" className="flex items-center gap-2" onClick={() => setIsCreateViewModalOpen(true)}>
<PrimaryButton
type="button"
className="flex items-center gap-2"
onClick={() => {
const e = new KeyboardEvent("keydown", { key: "v" });
document.dispatchEvent(e);
}}
>
<PlusIcon className="w-4 h-4" />
Create View
</PrimaryButton>
@ -100,7 +107,6 @@ const ProjectViews: NextPage<UserAuth> = (props) => {
title="Create New View"
description="Views aid in saving your issues by applying various filters and grouping options."
imgURL={emptyView}
action={() => setIsCreateViewModalOpen(true)}
/>
)
) : (