From d26d01ace4858fd5d17f07845d61c75babed20f5 Mon Sep 17 00:00:00 2001 From: Kunal Vishwakarma <116634168+kunalv17@users.noreply.github.com> Date: Mon, 17 Apr 2023 17:42:02 +0530 Subject: [PATCH] chore: filters spacing (#856) --- apps/app/components/core/issues-view.tsx | 59 ++++++++++--------- .../components/issues/my-issues-list-item.tsx | 4 +- .../pages/[workspaceSlug]/me/my-issues.tsx | 5 +- 3 files changed, 35 insertions(+), 33 deletions(-) diff --git a/apps/app/components/core/issues-view.tsx b/apps/app/components/core/issues-view.tsx index 520b5be17..a964181cd 100644 --- a/apps/app/components/core/issues-view.tsx +++ b/apps/app/components/core/issues-view.tsx @@ -359,6 +359,9 @@ export const IssuesView: React.FC = ({ (key) => filters[key as keyof IIssueFilterOptions] === null ); + const areFiltersApplied = + Object.keys(filters).length > 0 && nullFilters.length !== Object.keys(filters).length; + return ( <> = ({ isOpen={transferIssuesModal} /> {issueView !== "calendar" && ( -
+ <>
- {Object.keys(filters).length > 0 && - nullFilters.length !== Object.keys(filters).length && ( - { - if (viewId) { - setFilters({}, true); - setToastAlert({ - title: "View updated", - message: "Your view has been updated", - type: "success", - }); - } else - setCreateViewModal({ - query: filters, - }); - }} - className="flex items-center gap-2 text-sm" - > - {!viewId && } - {viewId ? "Update" : "Save"} view - - )} -
- {Object.keys(filters).length > 0 && - nullFilters.length !== Object.keys(filters).length && ( -
+ {areFiltersApplied && ( + { + if (viewId) { + setFilters({}, true); + setToastAlert({ + title: "View updated", + message: "Your view has been updated", + type: "success", + }); + } else + setCreateViewModal({ + query: filters, + }); + }} + className="flex items-center gap-2 text-sm" + > + {!viewId && } + {viewId ? "Update" : "Save"} view + )} -
+
+ {areFiltersApplied && ( +
+ )} + )} diff --git a/apps/app/components/issues/my-issues-list-item.tsx b/apps/app/components/issues/my-issues-list-item.tsx index 9e3e85c22..bf8f1d39c 100644 --- a/apps/app/components/issues/my-issues-list-item.tsx +++ b/apps/app/components/issues/my-issues-list-item.tsx @@ -82,8 +82,8 @@ export const MyIssuesListItem: React.FC = ({ issue, properties, projectId const isNotAllowed = false; return ( -