mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
Prerequisite for the SubscriptionPurchase god-page decomposition. The applyPromoDiscount helper + its active-discount useQuery were inlined in SubscriptionPurchase.tsx and called from 9 sites across 3 purchase flows (classic wizard, tariff picker, tariff form, switch-tariff sheet). Lifting both into src/hooks/usePromoDiscount gives every future extracted sub-component a single seam to call, without threading the function through props or re-fetching the discount in each child. SubscriptionPurchase.tsx: 2054 → 2009 lines (-45).