Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Refactor bounty thumbnail and add completed email template

Kiran Kde7a161a6d98
diff --git a/packages/email/src/components/bounty-thumbnail.tsx b/packages/email/src/components/bounty-thumbnail.tsx
new file mode 100644
index 0000000000..fe8bc09fbf
--- /dev/null
+++ b/packages/email/src/components/bounty-thumbnail.tsx
@@ -0,0 +1,26 @@
+import { cn } from "@dub/utils";
+
+export function BountyThumbnailImage({
+ type,
+ className,
+}: {
+ type: "performance" | "submission";
+ className?: string;
+}) {
+ return (
+ <img
+ {...(type === "performance"
+ ? {
+ src: "https://assets.dub.co/icons/trophy.webp",
+ alt: "Trophy thumbnail",
+ }
+ : {
+ src: "https://assets.dub.co/icons/heart.webp",
+ alt: "Heart thumbnail",
+ })}
+ width={118}
+ height={118}
+ className={cn("size-full object-contain", className)}
+ />
+ );
+}
diff --git a/packages/email/src/templates/bounty-completed.tsx b/packages/email/src/templates/bounty-completed.tsx
new file mode 100644
index 0000000000..c3f0bcb70f
--- /dev/null
+++ b/packages/email/src/templates/bounty-completed.tsx
@@ -0,0 +1,93 @@
+import { DUB_WORDMARK } from "@dub/utils";
+import {
+ Body,
+ Container,
+ Head,
+ Heading,
+ Html,
+ Img,
+ Link,
+ Preview,
+ Section,
+ Tailwind,
+ Text,
+} from "@react-email/components";
+import { BountyThumbnailImage } from "src/components/bounty-thumbnail";
+import { Footer } from "../components/footer";
+
+export default function BountySubmitted({
+ bounty = {
+ name: "Promote Acme at your campus and earn $500 ",
+ type: "performance",
+ },
+ program = {
+ name: "Acme",
+ slug: "acme",
+ supportEmail: "[email protected]",
+ },
+ email = "[email protected]",
+}: {
+ bounty: {
+ name: string;
+ type: "performance" | "submission";
+ };
+ program: {
+ slug: string;
+ name: string;
+ supportEmail: string;
+ };
+ email: string;
+}) {
+ return (
+ <Html>
+ <Head />
+ <Preview>Bounty completed</Preview>
+ <Tailwind>
+ <Body className="mx-auto my-auto bg-white font-sans">
+ <Container className="mx-auto my-8 max-w-[600px] px-8 py-8">
+ <Section className="mt-8">
+ <Img src={DUB_WORDMARK} height="32" alt="Dub" />
+ </Section>
+
+ <Heading className="mx-0 my-8 p-0 text-lg font-medium text-black">
+ Bounty completed!
+ </Heading>
+
+ <Text className="text-sm leading-5 text-neutral-600">
+ Congratulations on completing the <strong>{bounty.name}</strong>{" "}
+ bounty!
+ </Text>
+
+ <Section className="flex h-[140px] items-center justify-center rounded-lg bg-neutral-100 py-1.5">
+ <BountyThumbnailImage type={bounty.type} />
+ </Section>
+
+ <Text className="text-sm leading-5 text-neutral-600">
+ Once <strong>{program.name}</strong> has confirmed your bounty,
+ the reward will be added to your payouts.
+ </Text>
+
+ <Text className="text-sm leading-5 text-neutral-600">
+ If you have any questions about the program please don’t hesitate
+ to reach out to the <strong>{program.name}</strong> team{" "}
+ <span className="font-semibold text-blue-600">
+ ({program.supportEmail})
+ </span>
+ </Text>
+
+ <Section className="mb-10 mt-6">
+ <Link
+ className="rounded-lg bg-neutral-900 px-6 py-3 text-[13px] font-medium text-white no-underline"
+ href={`https://partners.dub.co/programs/${program.slug}`}
+ >
+ Go to your dashboard
+ </Link>
+ </Section>
+
+ <Footer email={email} />
+ </Container>
+ </Body>
+ </Tailwind>
+ </Html>
+ );
+}
diff --git a/packages/email/src/templates/bounty-submitted.tsx b/packages/email/src/templates/bounty-submitted.tsx
index ac69916c97..e7050f52c3 100644
--- a/packages/email/src/templates/bounty-submitted.tsx
+++ b/packages/email/src/templates/bounty-submitted.tsx
@@ -1,4 +1,4 @@
-import { cn, DUB_WORDMARK } from "@dub/utils";
+import { DUB_WORDMARK } from "@dub/utils";
import {
Body,
Container,
@@ -12,6 +12,7 @@ import {
Tailwind,
Text,
} from "@react-email/components";
+import { BountyThumbnailImage } from "src/components/bounty-thumbnail";
import { Footer } from "../components/footer";
export default function BountySubmitted({
@@ -94,28 +95,3 @@ export default function BountySubmitted({
</Html>
);
}
-
-export function BountyThumbnailImage({
- type,
- className,
-}: {
- type: "performance" | "submission";
- className?: string;
-}) {
- return (
- <img
- {...(type === "performance"
- ? {
- src: "https://assets.dub.co/icons/trophy.webp",
- alt: "Trophy thumbnail",
- }
- : {
- src: "https://assets.dub.co/icons/heart.webp",
- alt: "Heart thumbnail",
- })}
- width={118}
- height={118}
- className={cn("size-full object-contain", className)}
- />
- );
-}