Files
bedolaga-cabinet/src
c0mrade f3eb3ea603 refactor(purchase): extract usePromoDiscount hook
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).
2026-05-26 23:40:15 +03:00
..