From 0a9e732ea41531cbe3680fb47a6432652bb4c400 Mon Sep 17 00:00:00 2001 From: Amit Sharma <74371312+Amit91848@users.noreply.github.com> Date: Mon, 1 Sep 2025 17:58:01 +0530 Subject: [PATCH] fix: Plain chat not opening from help button for free users and on bookings list page (#23491) --- .../web/components/plain/PlainContactForm.tsx | 8 +- .../plain/__tests__/PlainContactForm.test.tsx | 80 ++++++++----------- apps/web/components/plain/plainChat.tsx | 18 ++++- apps/web/lib/hooks/useIsBookingPage.ts | 3 +- .../shell/user-dropdown/UserDropdown.tsx | 16 +++- 5 files changed, 66 insertions(+), 59 deletions(-) diff --git a/apps/web/components/plain/PlainContactForm.tsx b/apps/web/components/plain/PlainContactForm.tsx index e0b6e726c3..039d19f5cf 100644 --- a/apps/web/components/plain/PlainContactForm.tsx +++ b/apps/web/components/plain/PlainContactForm.tsx @@ -1,6 +1,6 @@ "use client"; -import { useState } from "react"; +import { Dispatch, SetStateAction, useState } from "react"; import { Button } from "@calcom/ui/components/button"; import { FileUploader, type FileData } from "@calcom/ui/components/file-uploader"; @@ -9,8 +9,7 @@ import { Icon } from "@calcom/ui/components/icon"; import { Popover, PopoverContent, PopoverTrigger } from "@calcom/ui/components/popover"; import { showToast } from "@calcom/ui/components/toast"; -const PlainContactForm = () => { - const [isOpen, setIsOpen] = useState(false); +const PlainContactForm = ({ open, setIsOpen }: { open: boolean, setIsOpen: Dispatch> }) => { const [isSubmitting, setIsSubmitting] = useState(false); const [isSubmitted, setIsSubmitted] = useState(false); const [isUploadingImage, setIsUploadingImage] = useState(false); @@ -55,6 +54,7 @@ const PlainContactForm = () => { setIsUploadingImage(false); const formData = new FormData(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any uploadFormData.forEach(({ key, value }: any) => { formData.append(key, value); }); @@ -138,7 +138,7 @@ const PlainContactForm = () => { return (
- +