feat: add cal video logo whitelabel for organization (#12616)

This commit is contained in:
Udit Takkar authored and GitHub committed 2023-12-09 09:02:14 +00:00
1 parent 090b166b1c
commit e9ea0fcc20
31 files changed
+115 -35

No files matched your search

@@ -110,7 +110,7 @@ export const AddNewTeamsForm = () => {
onChange={(e) => handleInputChange(index, e)}
addOnClassname="bg-transparent p-0 border-l-0"
className={index > 0 ? "mb-2" : ""}
placeholder={t(`org_team_names_example_${index + 1}`) || t("org_team_names_example")}
placeholder={t(`org_team_names_example_${index + 1}`) || t("org_team_names_example_1")}
addOnSuffix={
index > 0 && (
<Button
@@ -14,7 +14,8 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
import { MembershipRole } from "@calcom/prisma/enums";
import { trpc } from "@calcom/trpc/react";
import type { RouterOutputs } from "@calcom/trpc/react";
import { Button, Form, Meta, showToast, SettingsToggle } from "@calcom/ui";
import { Button, Form, Meta, showToast, SettingsToggle, Avatar, ImageUploader } from "@calcom/ui";
import { Plus } from "@calcom/ui/components/icon";
type BrandColorsFormValues = {
brandColor: string;
@@ -83,6 +84,48 @@ const OrgAppearanceView = ({
/>
{isAdminOrOwner ? (
<div>
<div className="my-6">
<div className="flex items-center text-sm">
<Avatar
alt="calVideoLogo"
imageSrc={currentOrg?.calVideoLogo}
fallback={<Plus className="text-subtle h-6 w-6" />}
size="lg"
/>
<div className="ms-4">
<div className="flex gap-2">
<ImageUploader
target="avatar"
id="cal-video-logo-upload"
buttonMsg={
currentOrg?.calVideoLogo ? t("update_cal_video_logo") : t("upload_cal_video_logo")
}
handleAvatarChange={(newLogo) => {
mutation.mutate({
calVideoLogo: newLogo,
});
}}
disabled={mutation.isLoading}
imageSrc={currentOrg?.calVideoLogo ?? undefined}
uploadInstruction={t("cal_video_logo_upload_instruction")}
triggerButtonColor={currentOrg?.calVideoLogo ? "secondary" : "primary"}
/>
{currentOrg?.calVideoLogo && (
<Button
color="destructive"
disabled={mutation.isLoading}
onClick={() => {
mutation.mutate({
calVideoLogo: null,
});
}}>
{t("remove")}
</Button>
)}
</div>
</div>
</div>
</div>
<Form
form={themeForm}
handleSubmit={(value) => {