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 UnapprovedProgramPage states

Steven Tey9ee224bad7f4
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/unapproved-program-page.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/unapproved-program-page.tsx
index 1f544fe769..6123387892 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/unapproved-program-page.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/unapproved-program-page.tsx
@@ -22,11 +22,11 @@ const states: Record<
</>
),
}),
- rejected: () => ({
- title: "Application reviewed",
+ rejected: (programEnrollment) => ({
+ title: "Application rejected",
description: "Your application has been rejected.",
}),
- banned: () => ({
+ banned: (programEnrollment) => ({
title: "Program unavailable",
description: "You have been banned from this program.",
}),
@@ -59,6 +59,19 @@ export function UnapprovedProgramPage({
</h2>
<p className="text-content-subtle [&_strong]:text-content-default mt-2 max-w-sm text-sm font-medium [&_strong]:font-semibold">
{description}
+ {programEnrollment.program.supportEmail &&
+ ["rejected", "banned"].includes(programEnrollment.status) && (
+ <>
+ Contact{" "}
+ <a
+ href={`mailto:${programEnrollment.program.supportEmail}`}
+ className="text-neutral-500 underline decoration-dotted underline-offset-2 transition-colors hover:text-neutral-800"
+ >
+ {programEnrollment.program.supportEmail}
+ </a>{" "}
+ to appeal.
+ </>
+ )}
</p>
</div>
</PageWidthWrapper>
diff --git a/apps/web/ui/layout/sidebar/partners-sidebar-nav.tsx b/apps/web/ui/layout/sidebar/partners-sidebar-nav.tsx
index f19efeffa1..aeebd8203b 100644
--- a/apps/web/ui/layout/sidebar/partners-sidebar-nav.tsx
+++ b/apps/web/ui/layout/sidebar/partners-sidebar-nav.tsx
@@ -113,7 +113,7 @@ const NAV_AREAS: SidebarNavAreas<SidebarNavData> = {
items: [
{
name: isUnapproved ? "Application" : "Overview",
- icon: Gauge6,
+ icon: isUnapproved ? UserCheck : Gauge6,
href: `/programs/${programSlug}`,
exact: true,
},
diff --git a/apps/web/ui/partners/program-card.tsx b/apps/web/ui/partners/program-card.tsx
index 3393dfa2c6..b12af7d15e 100644
--- a/apps/web/ui/partners/program-card.tsx
+++ b/apps/web/ui/partners/program-card.tsx
@@ -1,9 +1,8 @@
import { usePartnerEarningsTimeseries } from "@/lib/swr/use-partner-earnings-timeseries";
import { ProgramEnrollmentProps } from "@/lib/types";
import { BlurImage, Link4, MiniAreaChart } from "@dub/ui";
-import { cn, formatDate, getPrettyUrl, OG_AVATAR_URL } from "@dub/utils";
+import { formatDate, getPrettyUrl, OG_AVATAR_URL } from "@dub/utils";
import NumberFlow from "@number-flow/react";
-import { addDays } from "date-fns";
import Linkify from "linkify-react";
import Link from "next/link";
import { useMemo } from "react";
@@ -37,14 +36,10 @@ export function ProgramCard({
const defaultLink = programEnrollment.links?.[0];
- const clickable = ["approved", "pending"].includes(status);
-
- const card = (
- <div
- className={cn(
- "flex h-full flex-col justify-between rounded-xl border border-neutral-200 bg-white p-5",
- clickable && "hover:drop-shadow-card-hover transition-[filter]",
- )}
+ return (
+ <Link
+ href={`/programs/${program.slug}`}
+ className="hover:drop-shadow-card-hover flex h-full flex-col justify-between rounded-xl border border-neutral-200 bg-white p-5 transition-[filter]"
>
<div>
<BlurImage
@@ -76,7 +71,7 @@ export function ProgramCard({
<div className="mt-4 flex h-20 items-center justify-center text-balance rounded-md border border-neutral-200 bg-neutral-50 p-5 text-center text-sm text-neutral-500">
{status === "pending" ? (
`Applied ${formatDate(createdAt)}`
- ) : status === "banned" ? (
+ ) : status === "banned" || status === "rejected" ? (
<Linkify
as="p"
options={{
@@ -86,25 +81,17 @@ export function ProgramCard({
"underline underline-offset-2 decoration-dotted text-neutral-400 hover:text-neutral-700",
}}
>
- You're banned from this program.
+ {status === "banned"
+ ? "You're banned from this program."
+ : "Your application has been rejected."}
{program.supportEmail
? ` Contact ${program.supportEmail} to appeal.`
: ""}
</Linkify>
- ) : (
- `You will be able to apply again after ${formatDate(
- addDays(createdAt, 30),
- )}`
- )}
+ ) : null}
</div>
)}
- </div>
- );
-
- return clickable ? (
- <Link href={`/programs/${program.slug}`}>{card}</Link>
- ) : (
- card
+ </Link>
);
}