From be0b707296a7c52b70bd7de95966b7699877c5dc Mon Sep 17 00:00:00 2001 From: Dhairyashil Shinde <93669429+dhairyashiil@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:32:36 +0530 Subject: [PATCH] style: take feedback dialog little right (#27892) --- .../components/FeedbackDialog.tsx | 81 +++++++++++++------ 1 file changed, 55 insertions(+), 26 deletions(-) diff --git a/apps/web/modules/feature-opt-in/components/FeedbackDialog.tsx b/apps/web/modules/feature-opt-in/components/FeedbackDialog.tsx index 5e088c2694..c05968378e 100644 --- a/apps/web/modules/feature-opt-in/components/FeedbackDialog.tsx +++ b/apps/web/modules/feature-opt-in/components/FeedbackDialog.tsx @@ -1,5 +1,6 @@ "use client"; +import { RATING_OPTIONS } from "@calcom/features/bookings/lib/rating"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; import { Button } from "@coss/ui/components/button"; @@ -9,7 +10,6 @@ import { cn } from "@coss/ui/lib/utils"; import { XIcon } from "lucide-react"; import type { ReactElement } from "react"; import { useState } from "react"; -import { RATING_OPTIONS } from "@calcom/features/bookings/lib/rating"; export interface FeedbackDialogProps { isOpen: boolean; @@ -44,15 +44,19 @@ export function FeedbackDialog({ const [comment, setComment] = useState(""); const [isSuccess, setIsSuccess] = useState(false); - const submitFeedbackMutation = trpc.viewer.feedback.submitFeedback.useMutation({ - onSuccess: () => { - setIsSuccess(true); - onSubmitSuccess?.(); - }, - onError: () => { - toastManager.add({ title: t("error_submitting_feedback"), type: "error" }); - }, - }); + const submitFeedbackMutation = + trpc.viewer.feedback.submitFeedback.useMutation({ + onSuccess: () => { + setIsSuccess(true); + onSubmitSuccess?.(); + }, + onError: () => { + toastManager.add({ + title: t("error_submitting_feedback"), + type: "error", + }); + }, + }); const handleSubmit = async (): Promise => { if (selectedRating === null) return; @@ -82,7 +86,12 @@ export function FeedbackDialog({ } // Visibility classes based on showOn - const visibilityClass = showOn === "desktop" ? "hidden sm:block" : showOn === "mobile" ? "sm:hidden" : ""; + const visibilityClass = + showOn === "desktop" + ? "hidden sm:block" + : showOn === "mobile" + ? "sm:hidden" + : ""; const showMobileBackdrop = showOn !== "desktop"; if (isSuccess) { @@ -90,24 +99,33 @@ export function FeedbackDialog({ <> {/* Mobile-only backdrop */} {showMobileBackdrop && ( -
+
)}
+ )} + >
-

{t("feedback_submitted_title")}

-

{t("feedback_submitted_description")}

+

+ {t("feedback_submitted_title")} +

+

+ {t("feedback_submitted_description")} +

-

{t(titleKey)}

-

{t(descriptionKey)}

+

{t(titleKey)}

+

{t(descriptionKey)}

{RATING_OPTIONS.map((option) => ( @@ -150,9 +173,12 @@ export function FeedbackDialog({ onClick={() => setSelectedRating(option.value)} className={cn( "flex h-10 w-10 items-center justify-center rounded-lg text-xl transition-all", - selectedRating === option.value ? "bg-emphasis" : "hover:bg-subtle" + selectedRating === option.value + ? "bg-emphasis" + : "hover:bg-subtle" )} - aria-label={`Rating ${option.value}`}> + aria-label={`Rating ${option.value}`} + > {option.emoji} ))} @@ -173,7 +199,10 @@ export function FeedbackDialog({