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.

Use BountySubmissionStatus constants in UI code added for partiallyApproved

Rafi91a9a85f9e7d
diff --git a/apps/web/app/(ee)/app.dub.co/embed/referrals/bounties/submissions-table.tsx b/apps/web/app/(ee)/app.dub.co/embed/referrals/bounties/submissions-table.tsx
index 6d159b9ba8..2ae845320a 100644
--- a/apps/web/app/(ee)/app.dub.co/embed/referrals/bounties/submissions-table.tsx
+++ b/apps/web/app/(ee)/app.dub.co/embed/referrals/bounties/submissions-table.tsx
@@ -7,6 +7,7 @@ import {
} from "@/lib/bounty/periods";
import { PartnerBountyProps, PartnerBountySubmission } from "@/lib/types";
import { Button, StatusBadge, Table, useTable } from "@dub/ui";
+import { BountySubmissionStatus } from "@prisma/client";
import { ColumnDef } from "@tanstack/react-table";
import { useMemo } from "react";
@@ -114,9 +115,14 @@ export function EmbedBountySubmissionsTable({
buttonText = "Continue";
}
} else if (
- ["submitted", "partiallyApproved", "approved", "rejected"].includes(
- status,
- )
+ (
+ [
+ BountySubmissionStatus.submitted,
+ BountySubmissionStatus.partiallyApproved,
+ BountySubmissionStatus.approved,
+ BountySubmissionStatus.rejected,
+ ] as string[]
+ ).includes(status)
) {
buttonText = "View";
}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-submissions-table.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-submissions-table.tsx
index bca7310cc3..9e6c9077b0 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-submissions-table.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-submissions-table.tsx
@@ -39,6 +39,7 @@ import {
nFormatter,
timeAgo,
} from "@dub/utils";
+import { BountySubmissionStatus } from "@prisma/client";
import { Row } from "@tanstack/react-table";
import Link from "next/link";
import { useParams } from "next/navigation";
@@ -356,7 +357,7 @@ export function BountySubmissionsTable() {
user={row.original.user!}
date={row.original.reviewedAt}
label={
- row.original.status === "rejected"
+ row.original.status === BountySubmissionStatus.rejected
? "Rejected at"
: "Approved at"
}
@@ -430,9 +431,14 @@ export function BountySubmissionsTable() {
?.count || 0
: submissionsCount
?.filter((s) =>
- ["draft", "submitted", "partiallyApproved", "approved"].includes(
- s.status,
- ),
+ (
+ [
+ BountySubmissionStatus.draft,
+ BountySubmissionStatus.submitted,
+ BountySubmissionStatus.partiallyApproved,
+ BountySubmissionStatus.approved,
+ ] as BountySubmissionStatus[]
+ ).includes(s.status),
)
.reduce((acc, curr) => acc + curr.count, 0) || 0,
loading: isLoading || isBountyLoading,