From 0cd3bb5956c4aaedd2b2e57e93bb2ee64212564b Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Tue, 28 Feb 2023 14:42:46 +0530 Subject: [PATCH] style: kanban board --- .../components/core/board-view/all-boards.tsx | 8 ++- .../core/board-view/board-header.tsx | 31 +++++------- .../core/board-view/single-board.tsx | 7 ++- .../core/board-view/single-issue.tsx | 10 ++-- .../components/icons/backlog-state-icon.tsx | 21 ++++++++ .../components/icons/completed-state-icon.tsx | 33 ++++++++++++ apps/app/components/icons/index.ts | 5 ++ .../components/icons/started-state-icon.tsx | 36 +++++++++++++ .../app/components/icons/state-group-icon.tsx | 25 ++++++++++ .../issues/view-select/priority.tsx | 50 ++++++++++--------- apps/app/components/ui/custom-select.tsx | 42 +++++++++------- 11 files changed, 200 insertions(+), 68 deletions(-) create mode 100644 apps/app/components/icons/backlog-state-icon.tsx create mode 100644 apps/app/components/icons/completed-state-icon.tsx create mode 100644 apps/app/components/icons/started-state-icon.tsx create mode 100644 apps/app/components/icons/state-group-icon.tsx diff --git a/apps/app/components/core/board-view/all-boards.tsx b/apps/app/components/core/board-view/all-boards.tsx index f5b03267c..8e63d04e2 100644 --- a/apps/app/components/core/board-view/all-boards.tsx +++ b/apps/app/components/core/board-view/all-boards.tsx @@ -40,8 +40,13 @@ export const AllBoards: React.FC = ({
-
+
{Object.keys(groupedByIssues).map((singleGroup, index) => { + const currentState = + selectedGroup === "state_detail.name" + ? states?.find((s) => s.name === singleGroup) + : null; + const stateId = selectedGroup === "state_detail.name" ? states?.find((s) => s.name === singleGroup)?.id ?? null @@ -56,6 +61,7 @@ export const AllBoards: React.FC = ({ | null; groupTitle: string; bgColor?: string; @@ -28,6 +23,7 @@ type Props = { export const BoardHeader: React.FC = ({ groupedByIssues, + currentState, selectedGroup, groupTitle, bgColor, @@ -60,16 +56,13 @@ export const BoardHeader: React.FC = ({ >
+ {currentState && getStateGroupIcon(currentState.group)}

= ({ ? assignees : addSpaceIfCamelCase(groupTitle)}

- {groupedByIssues[groupTitle].length} + + {groupedByIssues[groupTitle].length} +
+ } noChevron disabled={isNotAllowed} selfPositioned={selfPositioned} diff --git a/apps/app/components/ui/custom-select.tsx b/apps/app/components/ui/custom-select.tsx index 677d7dab5..5890261a4 100644 --- a/apps/app/components/ui/custom-select.tsx +++ b/apps/app/components/ui/custom-select.tsx @@ -8,13 +8,13 @@ type CustomSelectProps = { value: any; onChange: any; children: React.ReactNode; - label: string | JSX.Element; + label?: string | JSX.Element; textAlignment?: "left" | "center" | "right"; maxHeight?: "sm" | "rg" | "md" | "lg" | "none"; width?: "auto" | string; input?: boolean; noChevron?: boolean; - buttonClassName?: string; + customButton?: JSX.Element; optionsClassName?: string; disabled?: boolean; selfPositioned?: boolean; @@ -30,7 +30,7 @@ const CustomSelect = ({ width = "auto", input = false, noChevron = false, - buttonClassName = "", + customButton, optionsClassName = "", disabled = false, selfPositioned = false, @@ -43,22 +43,26 @@ const CustomSelect = ({ disabled={disabled} >
- - {label} - {!noChevron && !disabled && + {customButton ? ( + customButton + ) : ( + + {label} + {!noChevron && !disabled && + )}