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.

display the created date for invites

Kiran Kec9d186f26ed
diff --git a/apps/web/app/(ee)/api/partner-profile/users/route.ts b/apps/web/app/(ee)/api/partner-profile/users/route.ts
index 5f9e31e7ad..c8e3655fa7 100644
--- a/apps/web/app/(ee)/api/partner-profile/users/route.ts
+++ b/apps/web/app/(ee)/api/partner-profile/users/route.ts
@@ -13,6 +13,7 @@ const partnerUserSchema = z.array(
email: z.string(),
role: z.nativeEnum(PartnerRole),
image: z.string().nullable(),
+ createdAt: z.date(),
}),
);
@@ -65,14 +66,16 @@ export const GET = withPartnerProfile(async ({ partner, searchParams }) => {
image: user.image,
email: user.email,
role,
+ createdAt: user.createdAt,
})),
- ...partnerInvites.map(({ email, role }) => ({
+ ...partnerInvites.map(({ email, createdAt, role }) => ({
id: null,
name: null,
image: null,
email,
role,
+ createdAt,
})),
]);
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/members/page-client.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/members/page-client.tsx
index 4bbddc7000..30f2f59c83 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/members/page-client.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/members/page-client.tsx
@@ -67,7 +67,9 @@ export function ProfileMembersPageClient() {
<Avatar user={user} />
<div className="flex flex-col">
<h3 className="text-sm font-medium">
- {user.name || user.email}
+ {user.id === null
+ ? `Invited ${timeAgo(user.createdAt)}`
+ : user.name || user.email}
</h3>
<p className="text-xs text-neutral-500">{user.email}</p>
{user.id === null && user.createdAt && (
@@ -181,7 +183,7 @@ export function ProfileMembersPageClient() {
inputClassName="w-full md:w-[16rem]"
/>
<select
- className="rounded-md border border-neutral-200 px-3 py-2 text-sm focus:border-neutral-600 focus:ring-neutral-600 w-28"
+ className="w-28 rounded-md border border-neutral-200 px-3 py-2 text-sm focus:border-neutral-600 focus:ring-neutral-600"
value={role || ""}
onChange={(e) => {
const newRole = e.target.value || null;
diff --git a/apps/web/lib/swr/use-partner-profile-users.ts b/apps/web/lib/swr/use-partner-profile-users.ts
index f0e12c5af7..a036dd6e9b 100644
--- a/apps/web/lib/swr/use-partner-profile-users.ts
+++ b/apps/web/lib/swr/use-partner-profile-users.ts
@@ -11,7 +11,7 @@ export type PartnerUserProps = {
email: string;
role: PartnerRole;
image: string | null;
- createdAt?: Date; // for invites
+ createdAt: Date;
};
const partialQuerySchema = getPartnerUsersQuerySchema.partial();