This PR implements two key features for the Stellabill frontend:
A merchant dashboard component displaying revenue trends with interactive time range selection.
Reusable subscription card components for the "My Subscriptions" page with comprehensive subscription details.
Components Created:
src/components/RevenueChart.tsx- Main chart componentsrc/components/RevenueChart.css- Dark theme stylingsrc/components/RevenueChart.api.md- API integration guide
Features:
- ✅ Dark theme background (#1a1a1a)
- ✅ "Revenue over time" title in bold white
- ✅ 7D/30D/90D time range selector with light blue active state (#60a5fa)
- ✅ SVG-based line chart with light blue line and circular markers
- ✅ Grid lines for better readability
- ✅ Y-axis with revenue values ($0 - $1600)
- ✅ X-axis with date labels
- ✅ Hover tooltips showing exact revenue values
- ✅ Responsive design with horizontal scroll on small screens
- ✅ Accessible with ARIA labels and semantic HTML
- ✅ Mock data generator with increasing trend
Technical Stack:
- Pure SVG implementation (no external chart libraries)
- React hooks (useState, useMemo)
- Responsive CSS with mobile-first approach
Integration:
- Added to Dashboard page (
src/pages/Dashboard.tsx) - Ready for API integration (see
RevenueChart.api.md)
Components Created:
src/components/SubscriptionCard.tsx- Reusable card componentsrc/components/SubscriptionCard.css- Dark theme stylingsrc/components/SubscriptionCard.api.md- API integration guide
Features:
- ✅ Dark theme card design (#1a1a1a background)
- ✅ Plan icon, name, and merchant display
- ✅ Status badges with color coding:
- Green (#22c55e) for Active with up arrow icon
- Yellow (#fbbf24) for Paused
- Red (#ef4444) for Cancelled
- ✅ Price display with currency and interval
- ✅ Subscription ID display
- ✅ Prepaid balance in teal pill (#14b8a6)
- ✅ Coverage calculation (~X payments)
- ✅ Next charge date with calendar icon
- ✅ Manage button linking to detail page
- ✅ External link icon for opening in new tab
- ✅ Responsive 2-column grid (stacks to 1 column on mobile)
- ✅ Loading and empty states
- ✅ Hover effects and smooth transitions
- ✅ Accessible with ARIA labels
Sample Data: Two subscription cards are displayed:
- Premium Access (Stellar News) - 10 USDC/month, 30 USDC balance
- Pro Plan (CloudFlow) - 25 USDC/month, 75 USDC balance
Technical Stack:
- TypeScript with proper type definitions
- React Router for navigation
- CSS Grid for responsive layout
- Semantic HTML for accessibility
Integration:
- Updated Subscriptions page (
src/pages/Subscriptions.tsx) - Ready for API integration (see
SubscriptionCard.api.md)
npm installnpm run dev- Revenue Chart: Navigate to Dashboard (
http://localhost:5173/) - Subscription Cards: Navigate to Subscriptions (
http://localhost:5173/subscriptions)
Both features are currently using mock data. To integrate with your backend:
GET /api/revenue?days={7|30|90}
Response:
{
"data": [
{ "date": "Jan 1", "revenue": 450 },
{ "date": "Jan 2", "revenue": 520 }
]
}GET /api/customer/subscriptions
Response:
{
"data": [
{
"id": "SUB-001",
"planName": "Premium Access",
"merchant": "Stellar News",
"status": "active",
"price": 10,
"currency": "USDC",
"interval": "month",
"prepaidBalance": 30,
"coverage": 3,
"nextChargeDate": "Mar 15, 2026",
"icon": "📰"
}
]
}See the respective .api.md files for detailed integration instructions.
- Chart renders with correct axes and labels
- Time range selector updates data (7D/30D/90D)
- Active button shows light blue background
- Hover tooltips display correct values
- Responsive design works on mobile
- Accessible with screen readers
- Cards render with all required fields
- Status badges display correct colors
- Prepaid balance shows in teal pill
- Manage button navigation works
- External link icon functions correctly
- Responsive grid adapts to screen size
- Loading and empty states display
- Hover effects work smoothly
Both features follow the Figma design specifications:
- Dark theme throughout (#1a1a1a backgrounds)
- Light blue accent color (#60a5fa) for active states
- Teal color (#14b8a6) for balance displays
- Proper spacing, typography, and visual hierarchy
- Responsive layouts for all screen sizes
- Accessibility best practices
src/components/RevenueChart.tsxsrc/components/RevenueChart.csssrc/components/RevenueChart.api.mdsrc/components/SubscriptionCard.tsxsrc/components/SubscriptionCard.csssrc/components/SubscriptionCard.api.mddocs/designs/revenue-chart-implementation.pngdocs/designs/subscription-cards-implementation.png
src/pages/Dashboard.tsx- Added RevenueChart componentsrc/pages/Subscriptions.tsx- Added SubscriptionCard grid
- Closes #49 - Implement merchant dashboard Revenue over time chart
- Closes #58 - Implement customer subscription cards
The chart displays revenue trends over selectable time periods (7D/30D/90D) with:
- Dark theme background
- Light blue line with markers
- Interactive tooltips
- Responsive grid layout
The cards show subscription details in a clean, organized layout with:
- Plan information and status
- Prepaid balance and coverage
- Next charge date
- Action buttons for management
Both features are production-ready and awaiting backend API integration.

