From c897f04926bb3c4108dda71134a0dd64934f88e3 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Wed, 1 Mar 2023 16:10:48 +0530 Subject: [PATCH] style: assignee drop down label --- .../app/components/issues/select/assignee.tsx | 21 +++++++++++++++---- apps/app/components/ui/avatar.tsx | 15 +++++++++++-- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/apps/app/components/issues/select/assignee.tsx b/apps/app/components/issues/select/assignee.tsx index 414ec2e9a..de77ca52b 100644 --- a/apps/app/components/issues/select/assignee.tsx +++ b/apps/app/components/issues/select/assignee.tsx @@ -10,6 +10,9 @@ import { Transition, Combobox } from "@headlessui/react"; import projectServices from "services/project.service"; // ui import { AssigneesList, Avatar } from "components/ui"; +// icons +import { UserGroupIcon } from "@heroicons/react/24/outline"; + // fetch keys import { PROJECT_MEMBERS } from "constants/fetch-keys"; @@ -61,10 +64,20 @@ export const IssueAssigneeSelect: FC = ({ > {({ open }: any) => ( <> - -
- {value && Array.isArray(value) ? : null} -
+ + + {value && value.length > 0 && Array.isArray(value) ? ( + <> + + Assignees + + ) : ( + <> + + Assignee + + )} + | (Partial | undefined)[] | Partial[]; userIds?: string[]; length?: number; + showTotalLength?: boolean; }; -export const AssigneesList: React.FC = ({ users, userIds, length = 5 }) => { +export const AssigneesList: React.FC = ({ + users, + userIds, + length = 5, + showTotalLength = false, +}) => { const router = useRouter(); const { workspaceSlug } = router.query; @@ -82,7 +88,12 @@ export const AssigneesList: React.FC = ({ users, userIds, len return ; })} - {userIds.length > length ? +{userIds.length - length} : null} + + {showTotalLength ? ( + {userIds.length} + ) : userIds.length > length ? ( + +{userIds.length - length} + ) : null} )}