mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +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="flex items-center">
|
||||||
<div className="mb-0.5 font-mono text-[10px] font-medium uppercase tracking-wider text-dark-50/30">
|
<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>
|
||||||
<div className="ml-3 text-base font-bold tracking-tight text-dark-50/50">
|
<div className="ml-3 text-base font-bold tracking-tight text-dark-50/50">
|
||||||
{formattedDate}
|
{formattedDate}
|
||||||
@@ -280,7 +280,7 @@ export default function SubscriptionCardExpired({
|
|||||||
>
|
>
|
||||||
<path d="M12 4.5v15m7.5-7.5h-15" />
|
<path d="M12 4.5v15m7.5-7.5h-15" />
|
||||||
</svg>
|
</svg>
|
||||||
{t('subscription.trafficLimited')}
|
{t('subscription.buyTraffic')}
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ export default function PurchaseCTAButton({
|
|||||||
}: PurchaseCTAButtonProps) {
|
}: PurchaseCTAButtonProps) {
|
||||||
const { t } = useTranslation();
|
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 isTrial = subscription?.is_trial;
|
||||||
const isDaily = subscription?.is_daily;
|
const isDaily = subscription?.is_daily;
|
||||||
|
|
||||||
|
|||||||
@@ -272,7 +272,8 @@
|
|||||||
"tariffs": "Tariffs",
|
"tariffs": "Tariffs",
|
||||||
"traffic": "Traffic",
|
"traffic": "Traffic",
|
||||||
"devices": "Devices",
|
"devices": "Devices",
|
||||||
"expiredDate": "Expired"
|
"expiredDate": "Expired",
|
||||||
|
"activeUntil": "Active until"
|
||||||
},
|
},
|
||||||
"suspended": {
|
"suspended": {
|
||||||
"title": "Subscription Suspended",
|
"title": "Subscription Suspended",
|
||||||
|
|||||||
@@ -284,7 +284,8 @@
|
|||||||
"tariffs": "Тарифы",
|
"tariffs": "Тарифы",
|
||||||
"traffic": "Трафик",
|
"traffic": "Трафик",
|
||||||
"devices": "Устройства",
|
"devices": "Устройства",
|
||||||
"expiredDate": "Истекла"
|
"expiredDate": "Истекла",
|
||||||
|
"activeUntil": "Активна до"
|
||||||
},
|
},
|
||||||
"suspended": {
|
"suspended": {
|
||||||
"title": "Подписка приостановлена",
|
"title": "Подписка приостановлена",
|
||||||
|
|||||||
@@ -957,7 +957,7 @@ export default function Subscription() {
|
|||||||
<div className="mb-5">
|
<div className="mb-5">
|
||||||
<CountdownTimer
|
<CountdownTimer
|
||||||
endDate={subscription.end_date}
|
endDate={subscription.end_date}
|
||||||
isActive={subscription.is_active}
|
isActive={subscription.is_active || subscription.is_limited}
|
||||||
glassColors={g}
|
glassColors={g}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user