Skip to content

Scheduling infrastructure for absolutely everyone.

fixes #3336 - Avatar on New Event Type (#3465)

noobyogi0010e82bcb6dba62
diff --git a/apps/web/components/eventtype/CreateEventType.tsx b/apps/web/components/eventtype/CreateEventType.tsx
index 10e18bb5879..6685879ce4c 100644
--- a/apps/web/components/eventtype/CreateEventType.tsx
+++ b/apps/web/components/eventtype/CreateEventType.tsx
@@ -6,6 +6,7 @@ import { useEffect } from "react";
import { useForm } from "react-hook-form";
import type { z } from "zod";
+import { WEBAPP_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import showToast from "@calcom/lib/notification";
import { createEventTypeInput } from "@calcom/prisma/zod/custom/eventtype";
@@ -164,7 +165,7 @@ export default function CreateEventTypeButton(props: Props) {
onSelect={() => openModal(option)}>
<Avatar
alt={option.name || ""}
- imageSrc={option.image}
+ imageSrc={option.image || `${WEBAPP_URL}/${option.slug}/avatar.png`} // if no image, use default avatar
size={6}
className="inline ltr:mr-2 rtl:ml-2"
/>