Unified Dashboard
Overview
Purpose
Architecture
Component Structure
UnifiedEarningsDashboard
├── useEarnings (combined data hook)
│ ├── useReferrals
│ ├── useRewards
│ └── usePoints
├── Tabs (navigation)
│ ├── Overview (aggregated summary)
│ ├── Rewards (trading cashback)
│ ├── Referrals (commission earnings)
│ └── Points (gamification)
└── Mobile/Desktop Rendering
├── Sheet (mobile)
└── Dialog (desktop)Data Flow
useEarnings Hook
useEarnings HookPurpose
Implementation
Usage
Benefits
Component: UnifiedEarningsDashboard
Props
Features
Tab Structure
Tab 1: Overview (Default)
Tab 2: Rewards
Tab 3: Referrals
Tab 4: Points
Responsive Behavior
Desktop (≥768px)
Mobile (<768px)
Implementation
Integration Examples
Open Dashboard from Button
Display Earnings Summary
Quick Claim Button
User Flows
Flow 1: Check Total Earnings
Flow 2: Claim Pending Earnings
Flow 3: Track Progress
Flow 4: Deep Dive into System
Best Practices
For Developers
For Product
Performance Optimization
Data Fetching
Memoization
Real-time Updates
Troubleshooting
Data Not Loading
Totals Incorrect
Modal Not Opening
Tabs Not Switching
Future Enhancements
Potential Features
Technical Improvements
Last updated
Was this helpful?