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.

Bounty completed state updates

Tim Wilson6e82fdabdb71
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/bounties/bounty-card.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/bounties/bounty-card.tsx
index eea8c50d03..8a09fa7659 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/bounties/bounty-card.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/bounties/bounty-card.tsx
@@ -59,9 +59,18 @@ export function BountyCard({ bounty }: { bounty: BountyWithPartnerDataProps }) {
</StatusBadge>
) : (
<StatusBadge variant="success">
- Confirmed{" "}
- {submission.reviewedAt &&
- formatDate(submission.reviewedAt, { month: "short" })}
+ {bounty.type === "performance" ? (
+ <>
+ Completed{" "}
+ {formatDate(submission.createdAt, { month: "short" })}
+ </>
+ ) : (
+ <>
+ Confirmed{" "}
+ {submission.reviewedAt &&
+ formatDate(submission.reviewedAt, { month: "short" })}
+ </>
+ )}
</StatusBadge>
)
) : bounty.type === "performance" ? (
diff --git a/apps/web/ui/partners/bounties/claim-bounty-modal.tsx b/apps/web/ui/partners/bounties/claim-bounty-modal.tsx
index 150631b20d..f151d10b8a 100644
--- a/apps/web/ui/partners/bounties/claim-bounty-modal.tsx
+++ b/apps/web/ui/partners/bounties/claim-bounty-modal.tsx
@@ -17,12 +17,14 @@ import {
Modal,
StatusBadge,
Trash,
+ buttonVariants,
useEnterSubmit,
useRouterStuff,
} from "@dub/ui";
import { cn, formatDate } from "@dub/utils";
import { motion } from "framer-motion";
import { useAction } from "next-safe-action/hooks";
+import Link from "next/link";
import { Dispatch, SetStateAction, useState } from "react";
import ReactTextareaAutosize from "react-textarea-autosize";
import { toast } from "sonner";
@@ -184,8 +186,21 @@ function ClaimBountyModalContent({
</div>
{submission ? (
- <div className="mt-3">
+ <div className="mt-3 flex items-center gap-2">
+ {submission.status === "approved" && (
+ <Link
+ href={`/programs/${programEnrollment?.program.slug}/earnings?type=custom`}
+ target="_blank"
+ className={cn(
+ buttonVariants({ variant: "primary" }),
+ "flex h-7 w-fit items-center whitespace-nowrap rounded-lg border px-2.5 text-sm",
+ )}
+ >
+ View earnings
+ </Link>
+ )}
<StatusBadge
+ className="rounded-lg py-1.5"
variant={
submission.status === "pending"
? "pending"
@@ -195,16 +210,26 @@ function ClaimBountyModalContent({
}
icon={submission.status === "approved" ? undefined : null}
>
- {submission.status === "pending"
- ? `Submitted ${formatDate(submission.createdAt, { month: "short" })}`
- : submission.status === "approved"
- ? `Confirmed ${
- submission.reviewedAt &&
+ {submission.status === "pending" ? (
+ `Submitted ${formatDate(submission.createdAt, { month: "short" })}`
+ ) : submission.status === "approved" ? (
+ bounty.type === "performance" ? (
+ <>
+ Completed{" "}
+ {formatDate(submission.createdAt, { month: "short" })}
+ </>
+ ) : (
+ <>
+ Confirmed{" "}
+ {submission.reviewedAt &&
formatDate(submission.reviewedAt, {
month: "short",
- })
- }`
- : "Rejected"}
+ })}
+ </>
+ )
+ ) : (
+ "Rejected"
+ )}
</StatusBadge>
</div>
) : (