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.

final changes

Steven Tey1543173a69fb
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/settings/payouts/payout-table.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/settings/payouts/payout-table.tsx
index 73c9982c51..4e87bad5a9 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/settings/payouts/payout-table.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/settings/payouts/payout-table.tsx
@@ -89,17 +89,22 @@ export function PayoutTable() {
header: "Status",
cell: ({ row }) => {
const badge = PayoutStatusBadges[row.original.status];
- let tooltip: string | undefined = undefined;
-
- if (row.original.status === "failed" && row.original.failureReason) {
- tooltip = row.original.failureReason;
- } else if (
- row.original.status === "pending" &&
- row.original.amount >= row.original.program.minPayoutAmount
- ) {
- tooltip =
- "This payout will be processed depends on your program's payment schedule, which is usually at the beginning or the end of the month.";
- }
+ const tooltip = (() => {
+ if (
+ row.original.status === "failed" &&
+ row.original.failureReason
+ ) {
+ return row.original.failureReason;
+ }
+ if (row.original.status === "pending") {
+ return row.original.amount >= row.original.program.minPayoutAmount
+ ? "This payout will be processed depends on your program's payment schedule, which is usually at the beginning or the end of the month."
+ : `This program's minimum payout amount is ${currencyFormatter(
+ row.original.program.minPayoutAmount / 100,
+ )}. This payout will be accrued and processed during the next payout period.`;
+ }
+ return undefined;
+ })();
return badge ? (
<StatusBadge icon={badge.icon} variant={badge.variant}>
diff --git a/packages/email/src/templates/new-sale-alert-partner.tsx b/packages/email/src/templates/new-sale-alert-partner.tsx
index bba472869f..db603b9dfc 100644
--- a/packages/email/src/templates/new-sale-alert-partner.tsx
+++ b/packages/email/src/templates/new-sale-alert-partner.tsx
@@ -97,7 +97,17 @@ export function NewSaleAlertPartner({
You received{" "}
<strong className="text-black">{earningsInDollars}</strong> in
commission for this sale and it will be eligible for payout after
- the program's {program.holdingPeriodDays}-day holding period.
+ the program's {program.holdingPeriodDays}-day holding period (
+ <strong>
+ {new Date(
+ Date.now() + program.holdingPeriodDays * 24 * 60 * 60 * 1000,
+ ).toLocaleDateString("en-US", {
+ month: "long",
+ day: "numeric",
+ year: "numeric",
+ })}
+ </strong>
+ ).
</Text>
<Section className="mb-12 mt-8">