Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #179 - Replace autocomplete for contacts #220

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions apps/web/app/(app)/compose/ComposeEmailForm.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -166,12 +171,12 @@ export const ComposeEmailForm = (props: {
multiple
nullable={true}
>
<div className="flex w-full flex-wrap items-center">
<div className="flex min-h-10 w-full flex-1 flex-wrap items-center gap-2 rounded-md border border-gray-300 px-2 py-2 shadow-sm focus-within:border-black focus-within:ring-black disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-500 disabled:ring-gray-200 sm:text-sm">
{selectedEmailAddressses.map((emailAddress) => (
<Badge
key={emailAddress}
variant="outline"
className="mr-1.5"
className="h-8 rounded-md border-primary bg-primary text-white"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid primary and just go with the color. we don't use bg-primary anywhere in the codebase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

>
{extractNameFromEmail(emailAddress)}

Expand All @@ -185,10 +190,9 @@ export const ComposeEmailForm = (props: {
))}

<div className="relative flex-1">
<Combobox.Input
<ComboboxInput
value={searchQuery}
// styles copied and pasted from Input.tsx
className="block w-full flex-1 rounded-md border-gray-300 shadow-sm focus:border-black focus:ring-black disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-500 disabled:ring-gray-200 sm:text-sm"
className="w-full border-none py-0 focus:border-none focus:ring-0"
onChange={(event) => setSearchQuery(event.target.value)}
onKeyUp={(event) => {
if (event.key === "Enter") {
Expand Down Expand Up @@ -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={{
Expand Down
35 changes: 17 additions & 18 deletions apps/web/components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modals everywhere else on the site still work fine after this change?

Copy link
Contributor Author

@madhav-relish madhav-relish Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the only place where layout was not looking good was the VideoDemo.tsx modal (Demo video on the landing page) which is now fixed in the latest PR #201

"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,
},
)}
>
<DialogPanel
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,
},
)}
>
<DialogPanel>
{props.title && (
<DialogTitle as="h3" className="font-cal text-xl leading-6">
{props.title}
Expand Down