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 bounty card

Steven Tey42def25ccc53
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 e9edca7cf1..8eef437c1c 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
@@ -70,14 +70,12 @@ export function PartnerBountyCard({ bounty }: { bounty: PartnerBountyProps }) {
</div>
</div>
- {!expiredBounty && (
- <div className="flex grow flex-col justify-end">
- {renderSubmissionStatus({
- bounty,
- setShowClaimBountyModal,
- })}
- </div>
- )}
+ <div className="flex grow flex-col justify-end">
+ {renderSubmissionStatus({
+ bounty,
+ setShowClaimBountyModal,
+ })}
+ </div>
</button>
</>
);
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-card.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-card.tsx
index 5b15bf5286..4a6b286e96 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-card.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-card.tsx
@@ -48,16 +48,17 @@ export function BountyCard({ bounty }: { bounty: BountyListProps }) {
<BountyThumbnailImage bounty={bounty} />
</div>
- {bounty.endsAt && new Date(bounty.endsAt) < new Date() ? (
- <BountyEndedBadge endsAt={bounty.endsAt} />
- ) : null}
-
- {bounty.submissionsCountData &&
- bounty.submissionsCountData.submitted > 0 ? (
- <SubmissionsCountBadge
- count={bounty.submissionsCountData.submitted}
- />
- ) : null}
+ <div className="absolute left-2 top-2 z-10 flex flex-col gap-1.5">
+ {bounty.submissionsCountData &&
+ bounty.submissionsCountData.submitted > 0 && (
+ <SubmissionsCountBadge
+ count={bounty.submissionsCountData.submitted}
+ />
+ )}
+ {bounty.endsAt && new Date(bounty.endsAt) < new Date() && (
+ <BountyEndedBadge endsAt={bounty.endsAt} />
+ )}
+ </div>
</div>
<div className="flex flex-col gap-1.5">
@@ -113,23 +114,18 @@ export function BountyCard({ bounty }: { bounty: BountyListProps }) {
);
}
-function BountyEndedBadge({ endsAt }: { endsAt: Date }) {
+function SubmissionsCountBadge({ count }: { count: number }) {
return (
- <div className="absolute left-2 top-2 z-10">
- <div className="flex h-5 items-center gap-1 rounded-md bg-neutral-200 px-2 py-1 text-xs font-semibold text-neutral-600">
- Ended {formatDate(endsAt, { month: "short" })}
- </div>
+ <div className="flex h-5 w-fit items-center gap-1 rounded-md bg-blue-100 px-2 py-1 text-xs font-semibold text-blue-600">
+ {nFormatter(count, { full: true })} {pluralize("submission", count)}{" "}
+ awaiting review
</div>
);
}
-
-function SubmissionsCountBadge({ count }: { count: number }) {
+function BountyEndedBadge({ endsAt }: { endsAt: Date }) {
return (
- <div className="absolute left-2 top-2 z-10">
- <div className="flex h-5 items-center gap-1 rounded-md bg-blue-100 px-2 py-1 text-xs font-semibold text-blue-600">
- {nFormatter(count, { full: true })} {pluralize("submission", count)}{" "}
- awaiting review
- </div>
+ <div className="flex h-5 w-fit items-center gap-1 rounded-md bg-neutral-200 px-2 py-1 text-xs font-semibold text-neutral-600">
+ Ended {formatDate(endsAt, { month: "short" })}
</div>
);
}