From 0cd3bb5956c4aaedd2b2e57e93bb2ee64212564b Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Tue, 28 Feb 2023 14:42:46 +0530 Subject: [PATCH 1/2] 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 f5b03267ccf..8e63d04e2ad 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 677d7dab58a..5890261a4a4 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 && + )}
Date: Wed, 1 Mar 2023 11:30:49 +0530 Subject: [PATCH 2/2] style: added dragging state design --- .../components/core/board-view/all-boards.tsx | 2 +- .../core/board-view/board-header.tsx | 8 +- .../core/board-view/single-board.tsx | 26 +++--- .../core/board-view/single-issue.tsx | 2 +- apps/app/components/core/issues-view.tsx | 4 +- .../components/icons/backlog-state-icon.tsx | 2 +- .../components/icons/cancelled-state-icon.tsx | 78 ++++++++++++++++++ .../components/icons/completed-state-icon.tsx | 66 ++++++++++++---- apps/app/components/icons/index.ts | 2 + .../components/icons/started-state-icon.tsx | 79 ++++++++++++++----- .../app/components/icons/state-group-icon.tsx | 14 ++-- .../components/icons/unstarted-state-icon.tsx | 59 ++++++++++++++ apps/app/components/ui/custom-menu.tsx | 74 +++++++++-------- apps/app/components/ui/custom-select.tsx | 2 +- 14 files changed, 324 insertions(+), 94 deletions(-) create mode 100644 apps/app/components/icons/cancelled-state-icon.tsx create mode 100644 apps/app/components/icons/unstarted-state-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 8e63d04e2ad..9a1b96b2a4f 100644 --- a/apps/app/components/core/board-view/all-boards.tsx +++ b/apps/app/components/core/board-view/all-boards.tsx @@ -40,7 +40,7 @@ export const AllBoards: React.FC = ({
-
+
{Object.keys(groupedByIssues).map((singleGroup, index) => { const currentState = selectedGroup === "state_detail.name" diff --git a/apps/app/components/core/board-view/board-header.tsx b/apps/app/components/core/board-view/board-header.tsx index 7240e8ad8e2..84d4211906c 100644 --- a/apps/app/components/core/board-view/board-header.tsx +++ b/apps/app/components/core/board-view/board-header.tsx @@ -50,7 +50,7 @@ export const BoardHeader: React.FC = ({ return (
@@ -60,7 +60,7 @@ export const BoardHeader: React.FC = ({ !isCollapsed ? "mb-2 flex-col gap-y-2 py-2" : "" }`} > - {currentState && getStateGroupIcon(currentState.group)} + {currentState && getStateGroupIcon(currentState.group, "20", "20", bgColor)}

= ({
) : ( - - Add issue - + customButton={ + } - className="mt-1" optionsPosition="left" noBorder > diff --git a/apps/app/components/core/board-view/single-issue.tsx b/apps/app/components/core/board-view/single-issue.tsx index 8e8637beacf..b425a97e9e1 100644 --- a/apps/app/components/core/board-view/single-issue.tsx +++ b/apps/app/components/core/board-view/single-issue.tsx @@ -185,7 +185,7 @@ export const SingleBoardIssue: React.FC = ({ return (
= ({
- + Drop issue here to delete
)} diff --git a/apps/app/components/icons/backlog-state-icon.tsx b/apps/app/components/icons/backlog-state-icon.tsx index 42a33900212..48ae09524a9 100644 --- a/apps/app/components/icons/backlog-state-icon.tsx +++ b/apps/app/components/icons/backlog-state-icon.tsx @@ -6,7 +6,7 @@ export const BacklogStateIcon: React.FC = ({ width = "20", height = "20", className, - color = "black", + color = "#858e96", }) => ( = ({ + width = "20", + height = "20", + className, + color = "#f2655a", +}) => ( + + + + + + + + + + + + + +); diff --git a/apps/app/components/icons/completed-state-icon.tsx b/apps/app/components/icons/completed-state-icon.tsx index 7e38feef406..584245d58a2 100644 --- a/apps/app/components/icons/completed-state-icon.tsx +++ b/apps/app/components/icons/completed-state-icon.tsx @@ -12,22 +12,58 @@ export const CompletedStateIcon: React.FC = ({ width={width} height={height} className={className} - viewBox="0 0 20 20" - fill="none" xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 84.36 84.36" > - - - + + + + + + + + + + ); diff --git a/apps/app/components/icons/index.ts b/apps/app/components/icons/index.ts index 2e8474a48f5..e07e22c299b 100644 --- a/apps/app/components/icons/index.ts +++ b/apps/app/components/icons/index.ts @@ -5,6 +5,7 @@ export * from "./blocker-icon"; export * from "./bolt-icon"; export * from "./calendar-month-icon"; export * from "./cancel-icon"; +export * from "./cancelled-state-icon"; export * from "./clipboard-icon"; export * from "./comment-icon"; export * from "./completed-cycle-icon"; @@ -30,6 +31,7 @@ export * from "./started-state-icon"; export * from "./state-group-icon"; export * from "./tag-icon"; export * from "./tune-icon"; +export * from "./unstarted-state-icon"; export * from "./upcoming-cycle-icon"; export * from "./user-group-icon"; export * from "./user-icon-circle"; diff --git a/apps/app/components/icons/started-state-icon.tsx b/apps/app/components/icons/started-state-icon.tsx index fdca331863f..20de015379d 100644 --- a/apps/app/components/icons/started-state-icon.tsx +++ b/apps/app/components/icons/started-state-icon.tsx @@ -6,31 +6,72 @@ export const StartedStateIcon: React.FC = ({ width = "20", height = "20", className, - color = "#fcbe1d", + color = "#fbb040", }) => ( - - - + + + + + + + + + + ); diff --git a/apps/app/components/icons/state-group-icon.tsx b/apps/app/components/icons/state-group-icon.tsx index b899a026b05..17b13f0b2df 100644 --- a/apps/app/components/icons/state-group-icon.tsx +++ b/apps/app/components/icons/state-group-icon.tsx @@ -1,6 +1,10 @@ -import { BacklogStateIcon } from "./backlog-state-icon"; -import { CompletedStateIcon } from "./completed-state-icon"; -import { StartedStateIcon } from "./started-state-icon"; +import { + BacklogStateIcon, + CancelledStateIcon, + CompletedStateIcon, + StartedStateIcon, + UnstartedStateIcon, +} from "components/icons"; export const getStateGroupIcon = ( stateGroup: "backlog" | "unstarted" | "started" | "completed" | "cancelled", @@ -12,13 +16,13 @@ export const getStateGroupIcon = ( case "backlog": return ; case "unstarted": - return ; + return ; case "started": return ; case "completed": return ; case "cancelled": - return ; + return ; default: return <>; } diff --git a/apps/app/components/icons/unstarted-state-icon.tsx b/apps/app/components/icons/unstarted-state-icon.tsx new file mode 100644 index 00000000000..0fcad39ea5a --- /dev/null +++ b/apps/app/components/icons/unstarted-state-icon.tsx @@ -0,0 +1,59 @@ +import React from "react"; + +import type { Props } from "./types"; + +export const UnstartedStateIcon: React.FC = ({ + width = "20", + height = "20", + className, + color = "#858e96", +}) => ( + + + + + + + + + + +); diff --git a/apps/app/components/ui/custom-menu.tsx b/apps/app/components/ui/custom-menu.tsx index e34390eff1b..d82a1a3472e 100644 --- a/apps/app/components/ui/custom-menu.tsx +++ b/apps/app/components/ui/custom-menu.tsx @@ -15,6 +15,7 @@ type Props = { textAlignment?: "left" | "center" | "right"; noBorder?: boolean; optionsPosition?: "left" | "right"; + customButton?: JSX.Element; }; type MenuItemProps = { @@ -34,42 +35,47 @@ const CustomMenu = ({ textAlignment, noBorder = false, optionsPosition = "right", + customButton, }: Props) => ( -
- {ellipsis ? ( - - - - ) : ( - - {label} - {!noBorder && - )} -
+ {customButton ? ( + {customButton} + ) : ( +
+ {ellipsis ? ( + + + + ) : ( + + {label} + {!noBorder && + )} +
+ )}
{customButton ? ( - customButton + {customButton} ) : (