|
1 | 1 | import React, { useId, useState } from "react";
|
2 | 2 | import { ReferralState, Team } from "generatedApi";
|
3 | 3 | 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"; |
10 | 5 | import { useTeamOrbSubscription } from "api/billing";
|
11 | 6 | import { Sheet } from "dashboard-common/elements/Sheet";
|
12 | 7 | import { cn } from "dashboard-common/lib/cn";
|
@@ -68,9 +63,8 @@ export function ReferralsInner({
|
68 | 63 | <Sheet>
|
69 | 64 | <h3>Refer friends and earn free Convex resources</h3>
|
70 | 65 | <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. |
74 | 68 | </p>
|
75 | 69 |
|
76 | 70 | <div className="my-4 flex items-center gap-4">
|
@@ -119,28 +113,21 @@ export function ReferralsInner({
|
119 | 113 | <Loading fullHeight={false} className="h-48" />
|
120 | 114 | ) : (
|
121 | 115 | <div className="flex flex-col">
|
122 |
| - {referralState.verifiedReferrals.length === 0 && |
123 |
| - referralState.pendingReferrals.length === 0 ? ( |
| 116 | + {referralState.verifiedReferrals.length === 0 ? ( |
124 | 117 | <p className="text-content-secondary">
|
125 | 118 | No referrals yet. Share your referral link to get started!
|
126 | 119 | </p>
|
127 | 120 | ) : (
|
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 | + )) |
144 | 131 | )}
|
145 | 132 | </div>
|
146 | 133 | )}
|
@@ -185,33 +172,3 @@ function Copied({ className }: { className?: string }) {
|
185 | 172 | />
|
186 | 173 | );
|
187 | 174 | }
|
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