From 03c9e73a372f0357757a1835a933bedceaa7749a Mon Sep 17 00:00:00 2001 From: Fringg Date: Wed, 11 Mar 2026 02:58:43 +0300 Subject: [PATCH] feat: display promo group and active discount banners on gift page Add promo group banner (green) and active discount banner (orange) to gift subscription page. PeriodCard now shows original price strikethrough and discount percentage badge from server-calculated values. --- src/api/gift.ts | 3 +++ src/pages/GiftSubscription.tsx | 49 ++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/src/api/gift.ts b/src/api/gift.ts index 72c7d89..3a607d9 100644 --- a/src/api/gift.ts +++ b/src/api/gift.ts @@ -40,6 +40,9 @@ export interface GiftConfig { payment_methods: GiftPaymentMethod[]; balance_kopeks: number; currency_symbol: string; + promo_group_name: string | null; + active_discount_percent: number | null; + active_discount_expires_at: string | null; } export interface GiftPurchaseRequest { diff --git a/src/pages/GiftSubscription.tsx b/src/pages/GiftSubscription.tsx index 54bbc4e..6ae22f2 100644 --- a/src/pages/GiftSubscription.tsx +++ b/src/pages/GiftSubscription.tsx @@ -695,6 +695,55 @@ function BuyTabContent({ )} + {/* Promo group banner */} + {config.promo_group_name && ( +
+
+ + + +
+
+
+ {t('subscription.promoGroup.yourGroup', { name: config.promo_group_name })} +
+
+ {t('subscription.promoGroup.personalDiscountsApplied')} +
+
+
+ )} + + {/* Active discount banner */} + {config.active_discount_percent != null && config.active_discount_percent > 0 && ( +
+
+ + + +
+
+ {t('promo.discountApplied')} -{config.active_discount_percent}% +
+
+ )} + {/* Period selection */} {periodsForDisplay.length > 0 && (