From 032bc8b13684dc4b5f1ad705e0aa6d17687fb6f1 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Thu, 29 Jun 2023 17:53:41 +0530 Subject: [PATCH] fix: state icon color on group titles --- .../components/core/board-view/board-header.tsx | 15 ++------------- .../app/components/core/list-view/single-list.tsx | 5 ++--- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/apps/app/components/core/board-view/board-header.tsx b/apps/app/components/core/board-view/board-header.tsx index a5df7a4269d..30ec5c0fb7d 100644 --- a/apps/app/components/core/board-view/board-header.tsx +++ b/apps/app/components/core/board-view/board-header.tsx @@ -57,18 +57,6 @@ export const BoardHeader: React.FC = ({ : null ); - let bgColor = "#000000"; - if (selectedGroup === "state") bgColor = currentState?.color ?? "#000000"; - - if (selectedGroup === "priority") - groupTitle === "high" - ? (bgColor = "#dc2626") - : groupTitle === "medium" - ? (bgColor = "#f97316") - : groupTitle === "low" - ? (bgColor = "#22c55e") - : (bgColor = "#ff0000"); - const getGroupTitle = () => { let title = addSpaceIfCamelCase(groupTitle); @@ -96,7 +84,8 @@ export const BoardHeader: React.FC = ({ switch (selectedGroup) { case "state": - icon = currentState && getStateGroupIcon(currentState.group, "16", "16", bgColor); + icon = + currentState && getStateGroupIcon(currentState.group, "16", "16", currentState.color); break; case "priority": icon = getPriorityIcon(groupTitle, "text-lg"); diff --git a/apps/app/components/core/list-view/single-list.tsx b/apps/app/components/core/list-view/single-list.tsx index a8c6e4a51ae..b76f3ad8aab 100644 --- a/apps/app/components/core/list-view/single-list.tsx +++ b/apps/app/components/core/list-view/single-list.tsx @@ -33,7 +33,6 @@ import { PROJECT_ISSUE_LABELS, PROJECT_MEMBERS } from "constants/fetch-keys"; type Props = { type?: "issue" | "cycle" | "module"; currentState?: IState | null; - bgColor?: string; groupTitle: string; groupedByIssues: { [key: string]: IIssue[]; @@ -53,7 +52,6 @@ type Props = { export const SingleList: React.FC = ({ type, currentState, - bgColor, groupTitle, groupedByIssues, selectedGroup, @@ -113,7 +111,8 @@ export const SingleList: React.FC = ({ switch (selectedGroup) { case "state": - icon = currentState && getStateGroupIcon(currentState.group, "16", "16", bgColor); + icon = + currentState && getStateGroupIcon(currentState.group, "16", "16", currentState.color); break; case "priority": icon = getPriorityIcon(groupTitle, "text-lg");