From 1866fd77bbae5af2fe1191452e18b59cc8a75ead Mon Sep 17 00:00:00 2001 From: Kunal Vishwakarma <116634168+kunalv17@users.noreply.github.com> Date: Thu, 30 Mar 2023 13:53:03 +0530 Subject: [PATCH] fix: changed buttons to primary (#602) --- apps/app/components/icons/plus-icon.tsx | 2 +- apps/app/components/ui/header-button.tsx | 33 ------------------- apps/app/components/ui/index.ts | 1 - .../pages/[workspaceSlug]/me/my-issues.tsx | 17 +++++----- .../projects/[projectId]/cycles/index.tsx | 16 ++++----- .../projects/[projectId]/issues/index.tsx | 16 ++++----- .../projects/[projectId]/modules/index.tsx | 16 ++++----- .../projects/[projectId]/pages/index.tsx | 12 ++++--- .../projects/[projectId]/views/[viewId].tsx | 16 ++++----- .../pages/[workspaceSlug]/projects/index.tsx | 12 ++++--- 10 files changed, 55 insertions(+), 86 deletions(-) delete mode 100644 apps/app/components/ui/header-button.tsx diff --git a/apps/app/components/icons/plus-icon.tsx b/apps/app/components/icons/plus-icon.tsx index d91833d0b..0b958a21d 100644 --- a/apps/app/components/icons/plus-icon.tsx +++ b/apps/app/components/icons/plus-icon.tsx @@ -13,7 +13,7 @@ export const PlusIcon: React.FC = ({ width = "24", height = "24", classNa > ); diff --git a/apps/app/components/ui/header-button.tsx b/apps/app/components/ui/header-button.tsx deleted file mode 100644 index a3b117983..000000000 --- a/apps/app/components/ui/header-button.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import * as React from "react"; - -type HeaderButtonProps = { - Icon: any; - label: string; - disabled?: boolean; - onClick: () => void; - className?: string; - position?: "normal" | "reverse"; -}; - -export const HeaderButton = ({ - Icon, - label, - disabled = false, - onClick, - className = "", - position = "normal", -}: HeaderButtonProps) => ( - <> - - -); diff --git a/apps/app/components/ui/index.ts b/apps/app/components/ui/index.ts index 6af8e45d9..b52c66a00 100644 --- a/apps/app/components/ui/index.ts +++ b/apps/app/components/ui/index.ts @@ -8,7 +8,6 @@ export * from "./custom-search-select"; export * from "./custom-select"; export * from "./datepicker"; export * from "./empty-space"; -export * from "./header-button"; export * from "./loader"; export * from "./multi-input"; export * from "./multi-level-select"; diff --git a/apps/app/pages/[workspaceSlug]/me/my-issues.tsx b/apps/app/pages/[workspaceSlug]/me/my-issues.tsx index ccc5ea7df..0c961f778 100644 --- a/apps/app/pages/[workspaceSlug]/me/my-issues.tsx +++ b/apps/app/pages/[workspaceSlug]/me/my-issues.tsx @@ -10,7 +10,7 @@ import AppLayout from "layouts/app-layout"; // hooks import useIssues from "hooks/use-issues"; // ui -import { Spinner, EmptySpace, EmptySpaceItem, HeaderButton } from "components/ui"; +import { Spinner, EmptySpace, EmptySpaceItem, PrimaryButton } from "components/ui"; import { Breadcrumbs, BreadcrumbItem } from "components/breadcrumbs"; // hooks import useIssuesProperties from "hooks/use-issue-properties"; @@ -95,17 +95,16 @@ const MyIssuesPage: NextPage = () => { )} )} - { - const e = new KeyboardEvent("keydown", { - key: "c", - }); - + const e = new KeyboardEvent("keydown", { key: "c" }); document.dispatchEvent(e); }} - /> + > + + Add Issue + } > diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx index 3f34bad1d..0f6dbbf21 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx @@ -19,7 +19,7 @@ import AppLayout from "layouts/app-layout"; // components import { CompletedCyclesListProps, CreateUpdateCycleModal, CyclesList } from "components/cycles"; // ui -import { HeaderButton, Loader } from "components/ui"; +import { Loader, PrimaryButton } from "components/ui"; import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs"; // icons // types @@ -94,16 +94,16 @@ const ProjectCycles: NextPage = (props) => { } right={ - { - const e = new KeyboardEvent("keydown", { - key: "q", - }); + const e = new KeyboardEvent("keydown", { key: "q" }); document.dispatchEvent(e); }} - /> + > + + Add Cycle + } > = (props) => { right={
- { - const e = new KeyboardEvent("keydown", { - key: "c", - }); + const e = new KeyboardEvent("keydown", { key: "c" }); document.dispatchEvent(e); }} - /> + > + + Add Issue +
} > diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/modules/index.tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/modules/index.tsx index dd4dfb23f..1806c68dd 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/modules/index.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/modules/index.tsx @@ -16,7 +16,7 @@ import modulesService from "services/modules.service"; // components import { CreateUpdateModuleModal, SingleModuleCard } from "components/modules"; // ui -import { EmptyState, HeaderButton, Loader } from "components/ui"; +import { EmptyState, Loader, PrimaryButton } from "components/ui"; import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs"; // icons // types @@ -72,16 +72,16 @@ const ProjectModules: NextPage = (props) => { } right={ - { - const e = new KeyboardEvent("keydown", { - key: "m", - }); + const e = new KeyboardEvent("keydown", { key: "m" }); document.dispatchEvent(e); }} - /> + > + + Add Module + } > = (props) => { } right={ - setCreateUpdatePageModal(true)} - /> + > + + Create Page + } >
diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/views/[viewId].tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/views/[viewId].tsx index 89a1ad373..f9302e0fd 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/views/[viewId].tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/views/[viewId].tsx @@ -13,13 +13,13 @@ import AppLayout from "layouts/app-layout"; // contexts import { IssueViewContextProvider } from "contexts/issue-view.context"; // ui +import { CustomMenu, PrimaryButton } from "components/ui"; import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs"; // types import { UserAuth } from "types"; // fetch-keys import { PROJECT_DETAILS, VIEWS_LIST, VIEW_DETAILS } from "constants/fetch-keys"; import { IssuesFilterView, IssuesView } from "components/core"; -import { CustomMenu, HeaderButton } from "components/ui"; import { PlusIcon } from "@heroicons/react/24/outline"; import { truncateText } from "helpers/string.helper"; import { StackedLayersIcon } from "components/icons"; @@ -91,16 +91,16 @@ const SingleView: React.FC = (props) => { right={
- { - const e = new KeyboardEvent("keydown", { - key: "c", - }); + const e = new KeyboardEvent("keydown", { key: "c" }); document.dispatchEvent(e); }} - /> + > + + Add Issue +
} > diff --git a/apps/app/pages/[workspaceSlug]/projects/index.tsx b/apps/app/pages/[workspaceSlug]/projects/index.tsx index 65b6ce720..93d318def 100644 --- a/apps/app/pages/[workspaceSlug]/projects/index.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/index.tsx @@ -14,7 +14,7 @@ import AppLayout from "layouts/app-layout"; import { JoinProjectModal } from "components/project/join-project-modal"; import { DeleteProjectModal, SingleProjectCard } from "components/project"; // ui -import { HeaderButton, Loader, EmptyState } from "components/ui"; +import { Loader, EmptyState, PrimaryButton } from "components/ui"; import { Breadcrumbs, BreadcrumbItem } from "components/breadcrumbs"; // icons import { PlusIcon } from "@heroicons/react/24/outline"; @@ -44,14 +44,16 @@ const ProjectsPage: NextPage = () => { } right={ - { const e = new KeyboardEvent("keydown", { key: "p" }); document.dispatchEvent(e); }} - /> + > + + Add Project + } >