Skip to content

Commit 2fef96d

Browse files
committed
feat(ui): add referral_legacy display in usage component
- Add referral_legacy to grantTypeInfo with emerald color and Legacy label - Update description: referral is now "One-time bonus from referrals" - Move referral from expiringTypes to nonExpiringTypes - Add referral_legacy to expiringTypes (renews monthly)
1 parent aba2a9e commit 2fef96d

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

web/src/app/profile/components/usage-display.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,15 @@ const grantTypeInfo: Record<
5959
gradient: 'from-green-500/70 to-green-600/70',
6060
icon: <Users className="h-4 w-4" />,
6161
label: 'Referral Bonus',
62-
description: 'Earned by referring others',
62+
description: 'One-time bonus from referrals',
63+
},
64+
referral_legacy: {
65+
bg: 'bg-emerald-500',
66+
text: 'text-emerald-600 dark:text-emerald-400',
67+
gradient: 'from-emerald-500/70 to-emerald-600/70',
68+
icon: <Users className="h-4 w-4" />,
69+
label: 'Referral Bonus (Legacy)',
70+
description: 'Monthly recurring referral bonus',
6371
},
6472
purchase: {
6573
bg: 'bg-yellow-500',
@@ -234,6 +242,7 @@ export const UsageDisplay = ({
234242
const usedCredits: Record<FilteredGrantType, number> = {
235243
free: 0,
236244
referral: 0,
245+
referral_legacy: 0,
237246
purchase: 0,
238247
admin: 0,
239248
ad: 0,
@@ -252,8 +261,9 @@ export const UsageDisplay = ({
252261
})
253262

254263
// Group credits by expiration type (excluding organization)
255-
const expiringTypes: FilteredGrantType[] = ['free', 'referral']
256-
const nonExpiringTypes: FilteredGrantType[] = ['admin', 'purchase', 'ad']
264+
// referral_legacy renews monthly, referral (one-time) never expires
265+
const expiringTypes: FilteredGrantType[] = ['free', 'referral_legacy']
266+
const nonExpiringTypes: FilteredGrantType[] = ['referral', 'admin', 'purchase', 'ad']
257267

258268
const expiringTotal = expiringTypes.reduce(
259269
(acc, type) => acc + (principals?.[type] || breakdown[type] || 0),

0 commit comments

Comments
 (0)