Skip to content

feat: add Earnings & Referrals dashboard layout with responsive structure and loading skeletons (Closes #1154) - #1203

Open
waterWang wants to merge 1 commit into
Agora-Events:mainfrom
waterWang:feat/1154-referral-dashboard-layout
Open

feat: add Earnings & Referrals dashboard layout with responsive structure and loading skeletons (Closes #1154)#1203
waterWang wants to merge 1 commit into
Agora-Events:mainfrom
waterWang:feat/1154-referral-dashboard-layout

Conversation

@waterWang

Copy link
Copy Markdown
Contributor

Summary

This PR implements Closes #1154 — Build Referral Dashboard Layout for the affiliates area.

What's included

  1. New component apps/web/components/affiliates/earnings-referrals-dashboard.tsx

    • Earnings Summary section — 4 KPI cards (Total Earnings, Pending Payouts, Withdrawable, Lifetime Clicks) using the existing AnalyticsKpiCard component from the design system
    • Referral Performance section — table with event name, clicks, sales, commission, and creation date; handles empty state natively
    • Payout History section — placeholder with "Coming soon" badge, ready for backend integration
    • Full loading skeleton — separate skeletons for each section (earnings summary, referral table, payout history) for a polished loading experience
    • Empty state — displayed when the affiliate has no activity yet, with a prompt to generate referral links
    • Error state — graceful fallback when API calls fail
    • Responsive layoutgrid-cols-1 sm:grid-cols-2 lg:grid-cols-4 for earnings cards, table scrolls horizontally on mobile
  2. Updated apps/web/app/affiliates/dashboard/page.tsx

    • Replaced the old AffiliateMetricsDashboard with the new EarningsReferralsDashboard
    • Updated page title from "Performance Metrics" to "Earnings & Referrals"
    • Retained the ReferralLinkGenerator component for link creation

Design decisions

  • Uses the existing project design system (border-2 border-black, shadow-[-6px_6px_0_rgba(0,0,0,1)], bg-surface, text-ink-deep, etc.)
  • Reuses AnalyticsKpiCard from analytics-kpi-card.tsx for consistent metric display
  • API call gracefully falls back to placeholder data when the backend (## BACKEND: Create Affiliate Registration Endpoint #1150) is not yet deployed
  • All sections are self-contained and ready for real data integration once the affiliate registration endpoint is live

Testing

  • Component renders without errors
  • Loading skeleton displays correctly
  • Empty state displays when no activity data
  • Error state displays when API call fails
  • Layout is responsive across breakpoints
  • Follows existing project coding conventions

…ture and loading skeletons

- Create EarningsReferralsDashboard component with:
  - Earnings Summary section (4 KPI cards: Total Earnings, Pending, Withdrawable, Lifetime Clicks)
  - Referral Performance section (table with loading/empty states)
  - Payout History section (placeholder, ready for backend integration)
  - Full loading skeleton states for all sections
  - Empty state for new affiliates
  - Error state for API failures
- Update affiliates/dashboard page to use new component
- All sections are responsive (grid-cols: 1/2/4)
- Placeholder sections ready for data integration when Agora-Events#1150 backend is complete

Closes Agora-Events#1154
@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

@waterWang is attempting to deploy a commit to the oseh-svg's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

## FRONTEND: Build Referral Dashboard Layout

1 participant