From 0fbdc0b157328ebe64d48acae14d54e4df44310a Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Fri, 18 Aug 2023 18:42:04 +0530 Subject: [PATCH] style: consistent ui for create update issue modal (#1907) --- .../app/components/issues/select/assignee.tsx | 2 +- apps/app/components/issues/select/date.tsx | 2 +- apps/app/components/issues/select/label.tsx | 8 +++--- apps/app/components/ui/labels-list.tsx | 26 ++++++++++--------- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/apps/app/components/issues/select/assignee.tsx b/apps/app/components/issues/select/assignee.tsx index 603483f0f..30c5cfc8d 100644 --- a/apps/app/components/issues/select/assignee.tsx +++ b/apps/app/components/issues/select/assignee.tsx @@ -49,7 +49,7 @@ export const IssueAssigneeSelect: React.FC = ({ projectId, value = [], on ) : ( -
+
Assignee
diff --git a/apps/app/components/issues/select/date.tsx b/apps/app/components/issues/select/date.tsx index fb88a8937..2b601f5dc 100644 --- a/apps/app/components/issues/select/date.tsx +++ b/apps/app/components/issues/select/date.tsx @@ -20,7 +20,7 @@ export const IssueDateSelect: React.FC = ({ label, maxDate, minDate, onCh {({ open }) => ( <> - + {value ? ( <> {renderShortDateWithYearFormat(value)} diff --git a/apps/app/components/issues/select/label.tsx b/apps/app/components/issues/select/label.tsx index b15a6f9c6..cf960b3a0 100644 --- a/apps/app/components/issues/select/label.tsx +++ b/apps/app/components/issues/select/label.tsx @@ -59,17 +59,17 @@ export const IssueLabelSelect: React.FC = ({ setIsOpen, value, onChange, > {({ open }: any) => ( <> - + {value && value.length > 0 ? ( - + issueLabels?.find((l) => l.id === v)?.color) ?? []} + labels={value.map((v) => issueLabels?.find((l) => l.id === v)) ?? []} length={3} showLength={true} /> ) : ( - + Label diff --git a/apps/app/components/ui/labels-list.tsx b/apps/app/components/ui/labels-list.tsx index 90658dd62..ba130acca 100644 --- a/apps/app/components/ui/labels-list.tsx +++ b/apps/app/components/ui/labels-list.tsx @@ -1,7 +1,11 @@ import React from "react"; +// ui +import { Tooltip } from "components/ui"; +// types +import { IIssueLabels } from "types"; type IssueLabelsListProps = { - labels?: (string | undefined)[]; + labels?: (IIssueLabels | undefined)[]; length?: number; showLength?: boolean; }; @@ -14,18 +18,16 @@ export const IssueLabelsList: React.FC = ({ <> {labels && ( <> - {labels.slice(0, length).map((color, index) => ( -
- + l?.name).join(", ")} + > +
+ + {`${labels.length} Labels`}
- ))} - {labels.length > length ? +{labels.length - length} : null} +
)}