From b39497519904f4e9190b707245d3e4bdbf193c36 Mon Sep 17 00:00:00 2001 From: Ryukemeister Date: Thu, 19 Oct 2023 02:48:50 +0530 Subject: [PATCH] update view for EventType --- packages/atoms/EventTypeList/EventType.tsx | 44 +++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/packages/atoms/EventTypeList/EventType.tsx b/packages/atoms/EventTypeList/EventType.tsx index 6a5b011201..c70618841d 100644 --- a/packages/atoms/EventTypeList/EventType.tsx +++ b/packages/atoms/EventTypeList/EventType.tsx @@ -1,7 +1,9 @@ import { memo } from "react"; +import { useOrgBranding } from "@calcom/ee/organizations/context/provider"; +import { WEBAPP_URL } from "@calcom/lib/constants"; import { SchedulingType } from "@calcom/prisma/enums"; -import { ArrowButton } from "@calcom/ui"; +import { ArrowButton, AvatarGroup } from "@calcom/ui"; const Item = ({ type, group, readOnly }: { type: any; group: any; readonly: boolean }) => { const content = () => ( @@ -68,6 +70,9 @@ export function EventType({ lastItem: { id: string }; moveEventType: (index: number, increment: 1 | -1) => void; }) { + const isManagedEventType = type.schedulingType === SchedulingType.MANAGED; + const orgBranding = useOrgBranding(); + return (
  • @@ -79,6 +84,43 @@ export function EventType({ moveEventType(index, 1)} /> )} +
    +
    + {type.team && !isManagedEventType && ( + ({ + alt: organizer.name || "", + image: `${orgBranding?.fullDomain ?? WEBAPP_URL}/${organizer.username}/avatar.png`, + title: organizer.name || "", + })) + : [] + } + /> + )} + {isManagedEventType && type?.children && type.children?.length > 0 && ( + ch.users) + .map((user: Pick) => ({ + alt: user.name || "", + image: `${orgBranding?.fullDomain ?? WEBAPP_URL}/${user.username}/avatar.png`, + title: user.name || "", + }))} + /> + )} +
    + {isManagedEventType && <>{type.hidden && <>Return badge here }} +
    +
    +