Skip to content

Commit c3668d3

Browse files
authored
fix: added team badge in event types (calcom#26536)
* added team badge in event types * added icon into the badge
1 parent 61a932f commit c3668d3

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

apps/web/modules/event-types/components/EventTypeLayout.tsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { EventTypeSetupProps } from "@calcom/features/eventtypes/lib/types"
88
import { useLocale } from "@calcom/lib/hooks/useLocale";
99
import { SchedulingType } from "@calcom/prisma/enums";
1010
import classNames from "@calcom/ui/classNames";
11+
import { Badge } from "@calcom/ui/components/badge";
1112
import { Button } from "@calcom/ui/components/button";
1213
import { ButtonGroup } from "@calcom/ui/components/buttonGroup";
1314
import { VerticalDivider } from "@calcom/ui/components/divider";
@@ -84,13 +85,11 @@ function EventTypeSingleLayout({
8485
formMethods,
8586
});
8687
const EventTypeTabs = tabsNavigation;
87-
const permalink = `${bookerUrl}/${
88-
team ? `${!team.parentId ? "team/" : ""}${team.slug}` : formMethods.getValues("users")[0].username
89-
}/${eventType.slug}`;
88+
const permalink = `${bookerUrl}/${team ? `${!team.parentId ? "team/" : ""}${team.slug}` : formMethods.getValues("users")[0].username
89+
}/${eventType.slug}`;
9090

91-
const embedLink = `${
92-
team ? `team/${team.slug}` : formMethods.getValues("users")[0].username
93-
}/${formMethods.getValues("slug")}`;
91+
const embedLink = `${team ? `team/${team.slug}` : formMethods.getValues("users")[0].username
92+
}/${formMethods.getValues("slug")}`;
9493
const isManagedEvent = formMethods.getValues("schedulingType") === SchedulingType.MANAGED ? "_managed" : "";
9594

9695
const [Shell] = useMemo(() => {
@@ -102,7 +101,16 @@ function EventTypeSingleLayout({
102101
<Shell
103102
backPath={teamId ? `/event-types?teamId=${teamId}` : "/event-types"}
104103
title={`${eventType.title} | ${t("event_type")}`}
105-
heading={eventType.title}
104+
heading={
105+
<div className="flex min-w-0 items-center">
106+
<span className="min-w-0 truncate">{eventType.title}</span>
107+
{eventType.team && (
108+
<Badge className="ml-2 text-xs" variant="gray" startIcon="users">
109+
{eventType.team.name}
110+
</Badge>
111+
)}
112+
</div>
113+
}
106114
CTA={
107115
<div className="flex items-center justify-end">
108116
{!formMethods.getValues("metadata")?.managedEventConfig && (

0 commit comments

Comments
 (0)