Skip to content

Commit e6ab955

Browse files
NicolappsConvex, Inc.
authored andcommitted
Update wording for instant referrals (#35885)
GitOrigin-RevId: bfce0ecc0a1ad98a5e7b6fa9179b68005ee37d5a
1 parent 14e9807 commit e6ab955

File tree

3 files changed

+16
-60
lines changed

3 files changed

+16
-60
lines changed

npm-packages/dashboard/src/api/referrals.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export function useApplyReferralCode(teamId?: number) {
1515
pathParams: {
1616
team_id: teamId?.toString() || "",
1717
},
18-
successToast:
19-
"Your referral code has been applied successfully. Create a project to validate the referral and receive your free resources.",
18+
successToast: "Congrats! Your referral code has been applied successfully.",
2019
});
2120
}

npm-packages/dashboard/src/components/referral/RedeemReferralForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export function RedeemReferralForm({
125125
<Spinner className="h-4 w-4" />
126126
) : (
127127
<div className="flex items-center gap-2">
128-
Apply my referral code
128+
Get my free resources
129129
{teamEligibility === undefined && (
130130
<Spinner className="h-4 w-4" />
131131
)}

npm-packages/dashboard/src/components/referral/Referrals.tsx

Lines changed: 14 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import React, { useId, useState } from "react";
22
import { ReferralState, Team } from "generatedApi";
33
import { TextInput } from "@common/elements/TextInput";
4-
import {
5-
CheckCircledIcon,
6-
CheckIcon,
7-
ClockIcon,
8-
CopyIcon,
9-
} from "@radix-ui/react-icons";
4+
import { CheckIcon, CopyIcon } from "@radix-ui/react-icons";
105
import { useTeamOrbSubscription } from "api/billing";
116
import { Sheet } from "dashboard-common/elements/Sheet";
127
import { cn } from "dashboard-common/lib/cn";
@@ -68,9 +63,8 @@ export function ReferralsInner({
6863
<Sheet>
6964
<h3>Refer friends and earn free Convex resources</h3>
7065
<p className="mt-1 max-w-lg text-content-secondary">
71-
Each time someone you referred creates their first project on Convex,
72-
both of your teams get the following benefits on top of your free plan
73-
limits.
66+
Each time you refer someone, both of your teams get the following
67+
benefits on top of your free plan limits.
7468
</p>
7569

7670
<div className="my-4 flex items-center gap-4">
@@ -119,28 +113,21 @@ export function ReferralsInner({
119113
<Loading fullHeight={false} className="h-48" />
120114
) : (
121115
<div className="flex flex-col">
122-
{referralState.verifiedReferrals.length === 0 &&
123-
referralState.pendingReferrals.length === 0 ? (
116+
{referralState.verifiedReferrals.length === 0 ? (
124117
<p className="text-content-secondary">
125118
No referrals yet. Share your referral link to get started!
126119
</p>
127120
) : (
128-
<>
129-
{referralState.verifiedReferrals.map((teamName, index) => (
130-
<ReferralListItem
131-
key={index}
132-
teamName={teamName}
133-
status="verified"
134-
/>
135-
))}
136-
{referralState.pendingReferrals.map((teamName, index) => (
137-
<ReferralListItem
138-
key={index}
139-
teamName={teamName}
140-
status="pending"
141-
/>
142-
))}
143-
</>
121+
referralState.verifiedReferrals.map((teamName, index) => (
122+
<div
123+
key={index}
124+
className="flex items-center justify-between border-b py-3 last:border-b-0"
125+
>
126+
<span className="text-sm text-content-primary">
127+
{teamName}
128+
</span>
129+
</div>
130+
))
144131
)}
145132
</div>
146133
)}
@@ -185,33 +172,3 @@ function Copied({ className }: { className?: string }) {
185172
/>
186173
);
187174
}
188-
189-
function ReferralListItem({
190-
teamName,
191-
status,
192-
}: {
193-
teamName: string;
194-
status: "pending" | "verified";
195-
}) {
196-
return (
197-
<div className="flex items-center justify-between border-b py-2 last:border-b-0">
198-
<span className="text-sm text-content-primary">{teamName}</span>
199-
<span
200-
className={cn(
201-
"flex items-center gap-1 rounded-full px-2 py-1 text-sm",
202-
status === "verified"
203-
? "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100"
204-
: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100",
205-
)}
206-
>
207-
{status === "pending" ? (
208-
<ClockIcon className="size-4" />
209-
) : (
210-
<CheckCircledIcon className="size-4" />
211-
)}
212-
213-
{status === "pending" ? "Waiting for first project" : "Validated"}
214-
</span>
215-
</div>
216-
);
217-
}

0 commit comments

Comments
 (0)