diff --git a/web/src/components/referral/ReferralDashboard.tsx b/web/src/components/referral/ReferralDashboard.tsx index 5001d899..3bc8c988 100644 --- a/web/src/components/referral/ReferralDashboard.tsx +++ b/web/src/components/referral/ReferralDashboard.tsx @@ -118,15 +118,15 @@ export const ReferralDashboard: React.FC = () => { - {/* Trust Score */} + {/* Referral Score */} - Trust Score + Referral Score - Reputation score from referrals + Score earned from referrals @@ -139,25 +139,24 @@ export const ReferralDashboard: React.FC = () => { - {/* Who Invited Me */} + {/* Pending Approvals Count */} - - Invited By + + Pending Approvals - Your referrer + Waiting for your approval - {stats?.whoInvitedMe ? ( -
- {stats.whoInvitedMe.slice(0, 8)}...{stats.whoInvitedMe.slice(-6)} -
- ) : ( -
- No referrer +
+ {loadingApprovals ? '...' : pendingApprovals.length} +
+ {stats?.whoInvitedMe && ( +
+ You were invited by {stats.whoInvitedMe.slice(0, 8)}...{stats.whoInvitedMe.slice(-6)}
)} @@ -194,82 +193,26 @@ export const ReferralDashboard: React.FC = () => { - {/* Pending Approvals */} - {(pendingApprovals.length > 0 || loadingApprovals) && ( - - - - - Pending Approvals ({pendingApprovals.length}) - - - These users listed you as their referrer and are waiting for your approval - - - - {loadingApprovals ? ( -
- -
- ) : ( -
- {pendingApprovals.map((approval) => ( -
-
-
- -
-
-
- {approval.applicantAddress.slice(0, 10)}...{approval.applicantAddress.slice(-8)} -
-
- - Pending Referral - -
-
-
- -
- ))} -
- )} -
-
- )} - - {/* My Referrals List */} + {/* My Invitations - Combined pending + confirmed */} - My Referrals ({myReferrals.length}) + My Invitations ({pendingApprovals.length + myReferrals.length}) - Users you have successfully referred + People you invited — approve pending ones to complete step 2 - {myReferrals.length === 0 ? ( + {loadingApprovals ? ( +
+ +
+ ) : pendingApprovals.length === 0 && myReferrals.length === 0 ? (
-

No referrals yet

+

No invitations yet

Invite friends to start building your network

@@ -283,6 +226,44 @@ export const ReferralDashboard: React.FC = () => {
) : (
+ {/* Pending approvals first */} + {pendingApprovals.map((approval) => ( +
+
+
+ +
+
+
+ {approval.applicantAddress.slice(0, 10)}...{approval.applicantAddress.slice(-8)} +
+
+ + Pending — Waiting Your Approval + +
+
+
+ +
+ ))} + + {/* Confirmed referrals */} {myReferrals.map((address, index) => (
{ >
- - {index + 1} - +
{address.slice(0, 10)}...{address.slice(-8)}
-
- KYC Completed +
+ + Confirmed +
- +{index < 10 ? 10 : index < 50 ? 5 : index < 100 ? 4 : 0} points + +{index < 10 ? 10 : index < 50 ? 5 : index < 100 ? 4 : 0} pts
))}