feat: add discount UI for landing pages

Add discount configuration in admin editor and countdown timer
display on public purchase page.

- Add discount section to AdminLandingEditor with toggle, percent
  slider, datetime pickers, per-tariff overrides, live preview
- Add DiscountBanner with countdown timer to QuickPurchase page
  using AnimatePresence exit animation and proper interval cleanup
- Add strikethrough prices and discount badges to tariff cards,
  summary card and pay button with null/equality guards
- Add discount translations for ru and en locales
- Fix delete/toggle API return types to match backend contracts
- Fix isoToDatetimeLocal to preserve seconds on re-edit
- Fix preview rounding to match backend integer division
This commit is contained in:
Fringg
2026-03-07 07:01:46 +03:00
parent c3cf805827
commit f7afa002f0
6 changed files with 474 additions and 12 deletions

View File

@@ -3215,7 +3215,18 @@
"loadingPeriods": "Loading...",
"periodDaySuffix": "d",
"localeTab": "Language",
"localeHint": "Switch language to edit text in that language"
"localeHint": "Switch language to edit text in that language",
"discount": "Discount",
"discountEnabled": "Enable discount",
"discountPercent": "Discount %",
"discountStartsAt": "Start date",
"discountEndsAt": "End date",
"discountBadge": "Banner text (optional)",
"discountBadgePlaceholder": "e.g. Spring sale!",
"discountOverrides": "Per-tariff overrides",
"discountOverridesHint": "Leave empty to use global discount",
"discountPreview": "Preview",
"discountActive": "Discount"
}
},
"adminUpdates": {
@@ -4003,6 +4014,12 @@
"giftPendingActivationDesc": "The recipient already has an active subscription. They will receive a link to activate the gift.",
"autoLoginFailed": "Auto-login failed",
"autoLoginProcessing": "Signing in...",
"discount": {
"days": "d",
"hours": "h",
"minutes": "m",
"seconds": "s"
},
"periodLabels": {
"d1": "1 day",
"d2": "2 days",