From 10ac3ee89aae5837e2f420896ab3b7784a3e8b5f Mon Sep 17 00:00:00 2001 From: madhav-relish Date: Tue, 27 Aug 2024 23:07:22 +0530 Subject: [PATCH] Fix #179 - Modal is now big and fully responsive - Simplified the styling - changed the design of the "To" autocomplete to the desired one --- .../app/(app)/compose/ComposeEmailForm.tsx | 18 ++++++---- apps/web/components/Modal.tsx | 35 +++++++++---------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/apps/web/app/(app)/compose/ComposeEmailForm.tsx b/apps/web/app/(app)/compose/ComposeEmailForm.tsx index 8807fb201..8831b3d00 100644 --- a/apps/web/app/(app)/compose/ComposeEmailForm.tsx +++ b/apps/web/app/(app)/compose/ComposeEmailForm.tsx @@ -1,6 +1,11 @@ "use client"; -import { Combobox, ComboboxOption, ComboboxOptions } from "@headlessui/react"; +import { + Combobox, + ComboboxInput, + ComboboxOption, + ComboboxOptions, +} from "@headlessui/react"; import { CheckCircleIcon, TrashIcon, XIcon } from "lucide-react"; import { EditorBubble, @@ -166,12 +171,12 @@ export const ComposeEmailForm = (props: { multiple nullable={true} > -
+
{selectedEmailAddressses.map((emailAddress) => ( {extractNameFromEmail(emailAddress)} @@ -185,10 +190,9 @@ export const ComposeEmailForm = (props: { ))}
- setSearchQuery(event.target.value)} onKeyUp={(event) => { if (event.key === "Enter") { @@ -296,7 +300,7 @@ export const ComposeEmailForm = (props: { setValue("messageHtml", editor.getHTML()); }} className={cn( - "relative min-h-32 w-full max-w-screen-lg bg-background sm:rounded-lg", + "relative min-h-32 w-full max-w-screen-lg rounded-xl border bg-background sm:rounded-lg", props.novelEditorClassName, )} editorProps={{ diff --git a/apps/web/components/Modal.tsx b/apps/web/components/Modal.tsx index cc3bc4641..80764465b 100644 --- a/apps/web/components/Modal.tsx +++ b/apps/web/components/Modal.tsx @@ -61,25 +61,24 @@ export function Modal(props: ModalProps) { leave="ease-in duration-200" leaveFrom="opacity-100 scale-100" leaveTo="opacity-0 scale-95" + className={clsx( + "w-full transform rounded-2xl bg-white text-left align-middle shadow-xl transition-all", + { + "p-6": props.padding === "sm", + "p-10": !props.padding, + "sm:w-full sm:max-w-xl": + !props.fullWidth && (!props.size || props.size === "xl"), + "sm:w-full sm:max-w-2xl": + !props.fullWidth && props.size === "2xl", + "sm:w-full sm:max-w-4xl": + !props.fullWidth && props.size === "4xl", + "sm:w-full sm:max-w-6xl": + !props.fullWidth && props.size === "6xl", + "sm:w-full sm:max-w-full": props.fullWidth, + }, + )} > - + {props.title && ( {props.title}