better animation on email detail
This commit is contained in:
@@ -5,6 +5,7 @@ import { api } from "~/trpc/react";
|
|||||||
import { Separator } from "@unsend/ui/src/separator";
|
import { Separator } from "@unsend/ui/src/separator";
|
||||||
import { EmailStatusBadge, EmailStatusIcon } from "./email-status-badge";
|
import { EmailStatusBadge, EmailStatusIcon } from "./email-status-badge";
|
||||||
import { formatDate } from "date-fns";
|
import { formatDate } from "date-fns";
|
||||||
|
import { motion } from "framer-motion";
|
||||||
import { EmailStatus } from "@prisma/client";
|
import { EmailStatus } from "@prisma/client";
|
||||||
import { JsonValue } from "@prisma/client/runtime/library";
|
import { JsonValue } from "@prisma/client/runtime/library";
|
||||||
import {
|
import {
|
||||||
@@ -19,10 +20,7 @@ import {
|
|||||||
COMPLAINT_ERROR_MESSAGES,
|
COMPLAINT_ERROR_MESSAGES,
|
||||||
DELIVERY_DELAY_ERRORS,
|
DELIVERY_DELAY_ERRORS,
|
||||||
} from "~/lib/constants/ses-errors";
|
} from "~/lib/constants/ses-errors";
|
||||||
import { Button } from "@unsend/ui/src/button";
|
|
||||||
import { Edit2, Edit3, Trash2 } from "lucide-react";
|
|
||||||
import CancelEmail from "./cancel-email";
|
import CancelEmail from "./cancel-email";
|
||||||
import EditSchedule from "./edit-schedule";
|
|
||||||
|
|
||||||
export default function EmailDetails({ emailId }: { emailId: string }) {
|
export default function EmailDetails({ emailId }: { emailId: string }) {
|
||||||
const emailQuery = api.email.getEmail.useQuery({ id: emailId });
|
const emailQuery = api.email.getEmail.useQuery({ id: emailId });
|
||||||
@@ -35,7 +33,7 @@ export default function EmailDetails({ emailId }: { emailId: string }) {
|
|||||||
<EmailStatusBadge status={emailQuery.data?.latestStatus ?? "SENT"} />
|
<EmailStatusBadge status={emailQuery.data?.latestStatus ?? "SENT"} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col mt-8 items-start">
|
<div className="flex flex-col mt-8 items-start gap-8">
|
||||||
<div className="p-2 rounded-lg border flex flex-col gap-2 w-full shadow">
|
<div className="p-2 rounded-lg border flex flex-col gap-2 w-full shadow">
|
||||||
{/* <div className="flex gap-2">
|
{/* <div className="flex gap-2">
|
||||||
<span className="w-[100px] text-muted-foreground text-sm">
|
<span className="w-[100px] text-muted-foreground text-sm">
|
||||||
@@ -84,6 +82,11 @@ export default function EmailDetails({ emailId }: { emailId: string }) {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0 }}
|
||||||
|
animate={{ opacity: 1 }}
|
||||||
|
transition={{ duration: 0.2, delay: 0.3 }}
|
||||||
|
>
|
||||||
<div className=" dark:bg-slate-200 h-[350px] overflow-visible rounded border-t ">
|
<div className=" dark:bg-slate-200 h-[350px] overflow-visible rounded border-t ">
|
||||||
<iframe
|
<iframe
|
||||||
className="w-full h-full"
|
className="w-full h-full"
|
||||||
@@ -91,6 +94,7 @@ export default function EmailDetails({ emailId }: { emailId: string }) {
|
|||||||
sandbox="allow-same-origin"
|
sandbox="allow-same-origin"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</motion.div>
|
||||||
</div>
|
</div>
|
||||||
{emailQuery.data?.latestStatus !== "SCHEDULED" ? (
|
{emailQuery.data?.latestStatus !== "SCHEDULED" ? (
|
||||||
<div className=" border rounded-lg w-full shadow mb-2 ">
|
<div className=" border rounded-lg w-full shadow mb-2 ">
|
||||||
|
Reference in New Issue
Block a user