mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
fix: limited (traffic exhausted) subscription shows as expired
- Dashboard card: change date label from "Истекла" to "Активна до" for limited subscriptions (traffic exhausted but time remaining) - Dashboard button: change text from "Трафик исчерпан" (dead-end) to "Докупить трафик" (actionable) for limited status - Subscription page: CountdownTimer shows remaining time for limited subs instead of "Истекла" (was passing is_active=false) - PurchaseCTAButton: don't treat limited as expired — limited subs still have time, should show extend CTA not "buy new subscription"
This commit is contained in:
@@ -228,7 +228,7 @@ export default function SubscriptionCardExpired({
|
||||
>
|
||||
<div className="flex items-center">
|
||||
<div className="mb-0.5 font-mono text-[10px] font-medium uppercase tracking-wider text-dark-50/30">
|
||||
{t('dashboard.expired.expiredDate')}
|
||||
{isLimited ? t('dashboard.expired.activeUntil') : t('dashboard.expired.expiredDate')}
|
||||
</div>
|
||||
<div className="ml-3 text-base font-bold tracking-tight text-dark-50/50">
|
||||
{formattedDate}
|
||||
@@ -280,7 +280,7 @@ export default function SubscriptionCardExpired({
|
||||
>
|
||||
<path d="M12 4.5v15m7.5-7.5h-15" />
|
||||
</svg>
|
||||
{t('subscription.trafficLimited')}
|
||||
{t('subscription.buyTraffic')}
|
||||
</Link>
|
||||
) : (
|
||||
<>
|
||||
|
||||
@@ -15,7 +15,9 @@ export default function PurchaseCTAButton({
|
||||
}: PurchaseCTAButtonProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const isExpired = !subscription || (!subscription.is_active && !subscription.is_trial);
|
||||
const isExpired =
|
||||
!subscription ||
|
||||
(!subscription.is_active && !subscription.is_trial && !subscription.is_limited);
|
||||
const isTrial = subscription?.is_trial;
|
||||
const isDaily = subscription?.is_daily;
|
||||
|
||||
|
||||
@@ -272,7 +272,8 @@
|
||||
"tariffs": "Tariffs",
|
||||
"traffic": "Traffic",
|
||||
"devices": "Devices",
|
||||
"expiredDate": "Expired"
|
||||
"expiredDate": "Expired",
|
||||
"activeUntil": "Active until"
|
||||
},
|
||||
"suspended": {
|
||||
"title": "Subscription Suspended",
|
||||
|
||||
@@ -284,7 +284,8 @@
|
||||
"tariffs": "Тарифы",
|
||||
"traffic": "Трафик",
|
||||
"devices": "Устройства",
|
||||
"expiredDate": "Истекла"
|
||||
"expiredDate": "Истекла",
|
||||
"activeUntil": "Активна до"
|
||||
},
|
||||
"suspended": {
|
||||
"title": "Подписка приостановлена",
|
||||
|
||||
@@ -957,7 +957,7 @@ export default function Subscription() {
|
||||
<div className="mb-5">
|
||||
<CountdownTimer
|
||||
endDate={subscription.end_date}
|
||||
isActive={subscription.is_active}
|
||||
isActive={subscription.is_active || subscription.is_limited}
|
||||
glassColors={g}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user