From 21fc75a17d1a11b74044f78eb236249e30905982 Mon Sep 17 00:00:00 2001 From: Fringg Date: Wed, 25 Feb 2026 12:04:35 +0300 Subject: [PATCH] refactor: simplify dashboard stats grid to 2 cards Remove Subscription and Earnings cards from StatsGrid. Merge earnings display into Referrals card as subtitle. Remove subscription-status onboarding step (target removed). --- src/components/dashboard/StatsGrid.tsx | 81 ++++++-------------------- src/pages/Dashboard.tsx | 7 --- 2 files changed, 17 insertions(+), 71 deletions(-) diff --git a/src/components/dashboard/StatsGrid.tsx b/src/components/dashboard/StatsGrid.tsx index 55ba036..64d6bb5 100644 --- a/src/components/dashboard/StatsGrid.tsx +++ b/src/components/dashboard/StatsGrid.tsx @@ -10,7 +10,6 @@ import { getGlassColors } from '../../utils/glassTheme'; interface StatsGridProps { balanceRubles: number; subscription: Subscription | null; - subLoading: boolean; referralCount: number; earningsRubles: number; refLoading: boolean; @@ -38,7 +37,6 @@ const ChevronIcon = ({ color }: { color: string }) => ( export default function StatsGrid({ balanceRubles, subscription, - subLoading, referralCount, earningsRubles, refLoading, @@ -81,37 +79,12 @@ export default function StatsGrid({ loading: false, onboarding: 'balance', }, - { - label: t('dashboard.stats.subscription'), - value: subscription ? `${subscription.days_left}` : '—', - valueSuffix: subscription ? ` ${t('subscription.daysShort')}` : '', - valueColor: g.text, - to: '/subscription', - icon: (color: string) => ( - - ), - iconBg: g.trackBg, - iconColor: g.textSecondary, - loading: subLoading, - onboarding: 'subscription-status', - }, { label: t('dashboard.stats.referrals'), value: `${referralCount}`, valueColor: g.text, + subtitle: `${formatPositive(earningsRubles)} ${currencySymbol}`, + subtitleColor: zone.mainHex, to: '/referral', icon: (color: string) => ( ( - - ), - iconBg: `${zone.mainHex}12`, - iconColor: zone.mainHex, - loading: refLoading, - }, ]; return ( @@ -194,17 +142,22 @@ export default function StatsGrid({ {card.loading ? (
) : ( -
- {card.value} - {card.valueSuffix && ( - - {card.valueSuffix} - + <> +
+ {card.value} +
+ {card.subtitle && ( +
+ {card.subtitle} +
)} -
+ )} ))} diff --git a/src/pages/Dashboard.tsx b/src/pages/Dashboard.tsx index 8806ba0..64dd386 100644 --- a/src/pages/Dashboard.tsx +++ b/src/pages/Dashboard.tsx @@ -191,12 +191,6 @@ export default function Dashboard() { description: t('onboarding.steps.balance.description'), placement: 'bottom', }, - { - target: 'subscription-status', - title: t('onboarding.steps.subscription.title'), - description: t('onboarding.steps.subscription.description'), - placement: 'bottom', - }, ]; if (subscription?.subscription_url) { @@ -270,7 +264,6 @@ export default function Dashboard() {