fix: platform-aware delete confirmation + trial CTA to purchase

Delete subscription:
- Telegram mini app: native destructive popup (red button)
- Web (mobile + desktop): Sheet bottom panel with full-width buttons
- Both: proper loading state on delete button

Trial CTA: leads to /subscription/purchase (trial cannot be renewed)
This commit is contained in:
c0mrade
2026-03-24 18:30:59 +03:00
parent 23edd6a211
commit debee7729f
2 changed files with 68 additions and 33 deletions

View File

@@ -38,9 +38,12 @@ export default function PurchaseCTAButton({
? t('subscription.cta.renewHint', 'Продление подписки')
: t('subscription.cta.activeHint');
// In multi-tariff mode: renew goes to per-subscription renew page
const linkTo =
isMultiTariff && subscription?.id
// Trial → purchase page (buy a real tariff, trial can't be renewed)
// Multi-tariff active → per-subscription renew page
// Otherwise → purchase page
const linkTo = isTrial
? '/subscription/purchase'
: isMultiTariff && subscription?.id
? `/subscriptions/${subscription.id}/renew`
: '/subscription/purchase';