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.

add awaiting review button

Steven Tey873edc5a9727
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 1dbd3953cf..f5c62f2bab 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
@@ -454,6 +454,7 @@ export function BountySubmissionsTable() {
<BountySubmissionFilters
bounty={bounty}
bountyInfo={bountyInfo}
+ submissionsCount={submissionsCount}
submissionsLength={submissions?.length ?? 0}
isRefreshingStats={isRefreshingStats}
refreshStats={refreshStats}
@@ -481,16 +482,19 @@ export function BountySubmissionsTable() {
function BountySubmissionFilters({
bounty,
bountyInfo,
+ submissionsCount,
submissionsLength,
isRefreshingStats,
refreshStats,
}: {
bounty: ReturnType<typeof useBounty>["bounty"];
bountyInfo: ReturnType<typeof resolveBountyDetails>;
+ submissionsCount?: SubmissionsCountByStatus[];
submissionsLength: number;
isRefreshingStats: boolean;
refreshStats: () => void;
}) {
+ const { queryParams, searchParams } = useRouterStuff();
const {
filters,
activeFilters,
@@ -501,18 +505,44 @@ function BountySubmissionFilters({
setSelectedFilter,
} = useBountySubmissionFilters({ bounty: bounty ?? undefined });
+ const submittedCount =
+ submissionsCount?.find((s) => s.status === "submitted")?.count ?? 0;
+
+ const showAwaitingReviewButton =
+ submittedCount > 0 && searchParams.get("status") !== "submitted";
+
return (
<>
<div className="flex w-full items-center justify-between gap-4">
- <Filter.Select
- className="w-full md:w-fit"
- filters={filters}
- activeFilters={activeFilters}
- onSelect={onSelect}
- onRemove={onRemove}
- onSearchChange={setSearch}
- onSelectedFilterChange={setSelectedFilter}
- />
+ <div className="flex items-center gap-2">
+ <Filter.Select
+ className="w-full md:w-fit"
+ filters={filters}
+ activeFilters={activeFilters}
+ onSelect={onSelect}
+ onRemove={onRemove}
+ onSearchChange={setSearch}
+ onSelectedFilterChange={setSelectedFilter}
+ />
+ {showAwaitingReviewButton ? (
+ <Button
+ text="Awaiting review"
+ variant="secondary"
+ className="w-fit"
+ right={
+ <span className="rounded-full bg-neutral-200 px-1.5 py-0.5 text-xs font-medium text-neutral-700">
+ {submittedCount}
+ </span>
+ }
+ onClick={() =>
+ queryParams({
+ set: { status: "submitted" },
+ del: "page",
+ })
+ }
+ />
+ ) : null}
+ </div>
{bountyInfo?.hasSocialMetrics && submissionsLength > 0 && (
<div className="flex shrink-0 items-center gap-3">
{bounty?.socialMetricsLastSyncedAt ? (