Skip to content

Commit fe3bd15

Browse files
authored
feat: UI optimizations for avatar, personal addresses and addNewAddresses modal (#621)
- Created a new `ExternalEmailModal` component for adding external email addresses to the organization - Updated `AddEmailModal` component to open the `ExternalEmailModal` when selecting 'Add External Email Instead' - Removed the obsolete external email page and transferred its functionalities to the new `ExternalEmailModal` component - Added state management for modals in the organization mail addresses page -Resizing avatar on account creation -Properly aligned personal addresses fixes issues: ENG-51 ENG-69 ENG-47
1 parent 4a7a812 commit fe3bd15

File tree

6 files changed

+534
-502
lines changed

6 files changed

+534
-502
lines changed

apps/web/src/app/[orgShortcode]/settings/org/mail/addresses/_components/add-address-modal.tsx

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {
66
DialogHeader,
77
DialogTrigger,
88
DialogTitle,
9-
DialogDescription
9+
DialogDescription,
10+
DialogClose
1011
} from '@/src/components/shadcn-ui/dialog';
1112
import {
1213
Select,
@@ -34,7 +35,6 @@ import { At } from '@phosphor-icons/react';
3435
import { useForm } from 'react-hook-form';
3536
import { platform } from '@/src/lib/trpc';
3637
import { useState } from 'react';
37-
import Link from 'next/link';
3838
import { z } from 'zod';
3939

4040
const addressFormSchema = z.object({
@@ -54,7 +54,11 @@ const addressFormSchema = z.object({
5454
})
5555
});
5656

57-
export function AddEmailModal() {
57+
export function AddEmailModal({
58+
addExternalModalOpen
59+
}: {
60+
addExternalModalOpen: (value: boolean) => void;
61+
}) {
5862
const orgShortcode = useGlobalStore((state) => state.currentOrg.shortcode);
5963
const invalidateEmails =
6064
platform.useUtils().org.mail.emailIdentities.getOrgEmailIdentities;
@@ -238,8 +242,8 @@ export function AddEmailModal() {
238242

239243
<div className="text-sm font-bold">Deliver Messages To</div>
240244
<div className="flex w-full flex-col gap-2">
241-
<div className="flex gap-2">
242-
<div className="flex flex-1 flex-col gap-1">
245+
<div className="grid grid-cols-2 gap-2">
246+
<div className="flex flex-1 flex-col gap-1 w-full">
243247
<div className="flex items-center gap-2">
244248
<label className="text-sm">Teams</label>
245249
</div>
@@ -369,16 +373,17 @@ export function AddEmailModal() {
369373
form.getFieldState('deliversTo').error?.message}
370374
</div>
371375

372-
<div className="mt-2 flex flex-wrap gap-2">
373-
<Button
374-
variant="secondary"
375-
className="flex-1"
376-
asChild>
377-
<Link
378-
href={`/${orgShortcode}/settings/org/mail/addresses/external`}>
379-
Add External Email Instead
380-
</Link>
381-
</Button>
376+
<div className="mt-2 grid grid-cols-2 gap-2">
377+
<DialogClose asChild>
378+
<Button
379+
variant="secondary"
380+
className="flex-1"
381+
onClick={() => addExternalModalOpen(true)}>
382+
{' '}
383+
Add External Email Instead{' '}
384+
</Button>
385+
</DialogClose>
386+
382387
<Button
383388
loading={isCreatingIdentity}
384389
className="flex-1"

0 commit comments

Comments
 (0)