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.

Merge branch 'main' into bounty-dynamic-reward-amount

Steven Teydc56b3eaac4e
diff --cc apps/web/ui/partners/bounties/claim-bounty-modal.tsx
index f0f33f3554,ef7f077b25..d5bc07eead
--- a/apps/web/ui/partners/bounties/claim-bounty-modal.tsx
+++ b/apps/web/ui/partners/bounties/claim-bounty-modal.tsx
@@@ -187,59 -187,93 +189,100 @@@ function ClaimBountyModalContent(
</span>
</div>
+ <div className="text-content-subtle flex items-center gap-2 text-sm font-medium">
+ <Gift className="size-3.5 shrink-0" />
+ <span className="truncate">
+ {getBountyRewardDescription(bounty)}
+ </span>
+ </div>
+
{submission ? (
- <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",
- )}
+ <div className="mt-3 grid gap-2">
+ <div className="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"
+ : submission.status === "approved"
+ ? "success"
+ : "error"
+ }
+ icon={submission.status === "approved" ? undefined : null}
>
- View earnings
- </Link>
- )}
- <StatusBadge
- className="rounded-lg py-1.5"
- variant={
- submission.status === "pending"
- ? "pending"
- : submission.status === "approved"
- ? "success"
- : "error"
- }
- icon={submission.status === "approved" ? undefined : null}
- >
- {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, {
+ {submission.status === "pending" ? (
+ `Submitted ${formatDate(submission.createdAt, { month: "short" })}`
+ ) : submission.status === "approved" ? (
+ bounty.type === "performance" ? (
+ <>
+ Completed{" "}
+ {formatDate(submission.createdAt, {
month: "short",
})}
- </>
- )
- ) : (
- "Rejected"
- )}
- </StatusBadge>
+ </>
+ ) : (
+ <>
+ Confirmed{" "}
+ {submission.reviewedAt &&
+ formatDate(submission.reviewedAt, {
+ month: "short",
+ })}
+ </>
+ )
+ ) : (
+ "Rejected"
+ )}
+ </StatusBadge>
+ </div>
+
+ {/* Rejection details for rejected submissions */}
+ {submission.status === "rejected" && (
+ <div className="mt-3 flex flex-col gap-2 rounded-lg border border-red-200 bg-red-50 p-4">
+ <div className="flex gap-1">
+ <span className="text-sm font-medium text-red-900">
+ Rejection reason:
+ </span>
+ <span className="text-sm text-red-800">
+ {submission.rejectionReason &&
+ REJECT_BOUNTY_SUBMISSION_REASONS[
+ submission.rejectionReason as keyof typeof REJECT_BOUNTY_SUBMISSION_REASONS
+ ]}
+ </span>
+ </div>
+ {submission.rejectionNote && (
+ <div className="mt-1">
+ <span className="text-sm font-medium text-red-900">
+ Note:
+ </span>
+ <Linkify
+ as="p"
+ options={{
+ target: "_blank",
+ rel: "noopener noreferrer nofollow",
+ format: (href) => getPrettyUrl(href),
+ className:
+ "underline underline-offset-4 text-red-400 hover:text-red-700",
+ }}
+ className="mt-1 whitespace-pre-wrap text-sm text-red-800"
+ >
+ {submission.rejectionNote}
+ </Linkify>
+ </div>
+ )}
+ </div>
+ )}
</div>
) : (
bounty.type === "performance" && (