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.

improve PartnerBountyCard timestamp, reduce withdrawal cron frequency

Steven Tey33de46c0c817
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/bounties/partner-bounty-card.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/bounties/partner-bounty-card.tsx
index 04c619222e..223a05d8d2 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/bounties/partner-bounty-card.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/bounties/partner-bounty-card.tsx
@@ -3,9 +3,14 @@ import { PartnerBountyProps } from "@/lib/types";
import { BountyPerformance } from "@/ui/partners/bounties/bounty-performance";
import { BountyThumbnailImage } from "@/ui/partners/bounties/bounty-thumbnail-image";
import { useClaimBountyModal } from "@/ui/partners/bounties/claim-bounty-modal";
-import { DynamicTooltipWrapper, StatusBadge, TooltipContent } from "@dub/ui";
+import {
+ DynamicTooltipWrapper,
+ StatusBadge,
+ TimestampTooltip,
+ TooltipContent,
+} from "@dub/ui";
import { Calendar6, Gift } from "@dub/ui/icons";
-import { cn, formatDate } from "@dub/utils";
+import { cn, formatDate, formatDateTimeSmart } from "@dub/utils";
import { useParams } from "next/navigation";
export function PartnerBountyCard({ bounty }: { bounty: PartnerBountyProps }) {
@@ -68,12 +73,21 @@ export function PartnerBountyCard({ bounty }: { bounty: PartnerBountyProps }) {
<div className="text-content-subtle flex items-center gap-2 text-sm font-medium">
<Calendar6 className="size-3.5" />
<span>
- {formatDate(bounty.startsAt, { month: "short" })}
- {bounty.endsAt && (
+ {bounty.endsAt ? (
<>
- {" → "}
- {formatDate(bounty.endsAt, { month: "short" })}
+ {expiredBounty ? "Ended" : "Ends"} at{" "}
+ <TimestampTooltip
+ timestamp={bounty.endsAt}
+ side="right"
+ rows={["local", "utc"]}
+ >
+ <span className="hover:text-content-emphasis underline decoration-dotted underline-offset-2">
+ {formatDateTimeSmart(bounty.endsAt)}
+ </span>
+ </TimestampTooltip>
</>
+ ) : (
+ `${formatDate(bounty.startsAt, { month: "short" })} → No end date`
)}
</span>
</div>
diff --git a/apps/web/vercel.json b/apps/web/vercel.json
index b77042440b..21ae6df592 100644
--- a/apps/web/vercel.json
+++ b/apps/web/vercel.json
@@ -38,7 +38,7 @@
},
{
"path": "/api/cron/trigger-withdrawal",
- "schedule": "0 0,12 * * *"
+ "schedule": "0 0 * * *"
},
{
"path": "/api/cron/partner-program-summary",