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.

update UI to match API

Steven Tey9c6e1bfa5649
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/[programSlug]/page.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/[programSlug]/page.tsx
index 5dc143d00c..1219432b96 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/[programSlug]/page.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/[programSlug]/page.tsx
@@ -13,7 +13,10 @@ import usePartnerProfile from "@/lib/swr/use-partner-profile";
import useProgramEnrollment from "@/lib/swr/use-program-enrollment";
import useUser from "@/lib/swr/use-user";
import { ProgramEnrollmentProps } from "@/lib/types";
-import { INACTIVE_ENROLLMENT_STATUSES } from "@/lib/zod/schemas/partners";
+import {
+ COMMISSION_ELIGIBLE_ENROLLMENT_STATUSES,
+ INACTIVE_ENROLLMENT_STATUSES,
+} from "@/lib/zod/schemas/partners";
import { useMessagesContext } from "@/ui/messages/messages-context";
import { MessagesPanel } from "@/ui/messages/messages-panel";
import { ToggleSidePanelButton } from "@/ui/messages/toggle-side-panel-button";
@@ -451,7 +454,7 @@ function ProgramInfoPanel({
const [copied, copyToClipboard] = useCopyToClipboard();
- const isInactiveEnrollment = INACTIVE_ENROLLMENT_STATUSES.includes(
+ const isActiveEnrollment = COMMISSION_ELIGIBLE_ENROLLMENT_STATUSES.includes(
programEnrollment.status,
);
@@ -473,9 +476,9 @@ function ProgramInfoPanel({
{program.name}
</span>
<span className="text-content-subtle text-sm font-medium">
- {isInactiveEnrollment
- ? `You have been ${programEnrollment.status} from this program`
- : `Partner since ${formatDate(programEnrollment.createdAt)}`}
+ {isActiveEnrollment
+ ? `Partner since ${formatDate(programEnrollment.createdAt)}`
+ : `You have been ${programEnrollment.status} from this program`}
</span>
</div>
</div>
@@ -484,7 +487,7 @@ function ProgramInfoPanel({
{/* Referral link */}
{programEnrollment.links &&
programEnrollment.links.length > 0 &&
- !isInactiveEnrollment && (
+ isActiveEnrollment && (
<div className="pl-6 pr-6 pt-7">
<div className="flex items-end justify-between">
<h3 className="text-content-emphasis text-sm font-semibold">
@@ -584,7 +587,7 @@ function ProgramInfoPanel({
</div>
{/* Rewards */}
- {!isInactiveEnrollment && (
+ {isActiveEnrollment && (
<div className="pl-6 pr-6 pt-7">
<h3 className="text-content-emphasis text-sm font-semibold">
Rewards