diff --git a/src/components/PromoDiscountBadge.tsx b/src/components/PromoDiscountBadge.tsx deleted file mode 100644 index 0abec44..0000000 --- a/src/components/PromoDiscountBadge.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { useQuery } from '@tanstack/react-query'; -import { Link } from 'react-router-dom'; -import { useTranslation } from 'react-i18next'; -import { promoApi } from '../api/promo'; - -export default function PromoDiscountBadge() { - const { t } = useTranslation(); - - const { data: activeDiscount } = useQuery({ - queryKey: ['active-discount'], - queryFn: promoApi.getActiveDiscount, - staleTime: 30000, - refetchInterval: 60000, - }); - - // Don't render if no active discount - if (!activeDiscount || !activeDiscount.is_active || !activeDiscount.discount_percent) { - return null; - } - - return ( - - 🏷️ - - -{activeDiscount.discount_percent}% - - - ); -} diff --git a/src/components/PromoOffersSection.tsx b/src/components/PromoOffersSection.tsx index c371791..5ff33ec 100644 --- a/src/components/PromoOffersSection.tsx +++ b/src/components/PromoOffersSection.tsx @@ -1,6 +1,7 @@ import { useState } from 'react'; import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import { useTranslation } from 'react-i18next'; +import { Link } from 'react-router-dom'; import { promoApi, PromoOffer } from '../api/promo'; // Icons @@ -148,22 +149,26 @@ export default function PromoOffersSection({ className = '' }: PromoOffersSectio return (
- {/* Active Discount Banner */} + {/* Active Discount Banner - clickable, navigates to subscription */} {activeDiscount && activeDiscount.is_active && activeDiscount.discount_percent > 0 && ( -
+
-
- +
+ 🏷️
-
+

{t('promo.offers.discountActiveTitle', { percent: activeDiscount.discount_percent, })}

- - {t('promo.offers.statusActive')} + + -{activeDiscount.discount_percent}%
@@ -179,8 +184,20 @@ export default function PromoOffersSection({ className = '' }: PromoOffersSectio )}
+ {/* Arrow indicator */} +
+ + + +
-
+ )} {/* Success/Error Messages */} diff --git a/src/components/layout/AppShell/AppHeader.tsx b/src/components/layout/AppShell/AppHeader.tsx index faf988f..002b32d 100644 --- a/src/components/layout/AppShell/AppHeader.tsx +++ b/src/components/layout/AppShell/AppHeader.tsx @@ -14,11 +14,9 @@ import { isLogoPreloaded, } from '@/api/branding'; import { themeColorsApi } from '@/api/themeColors'; -import { promoApi } from '@/api/promo'; import { cn } from '@/lib/utils'; import LanguageSwitcher from '@/components/LanguageSwitcher'; -import PromoDiscountBadge from '@/components/PromoDiscountBadge'; import TicketNotificationBell from '@/components/TicketNotificationBell'; // Icons @@ -78,7 +76,7 @@ export function AppHeader({ }: AppHeaderProps) { const { t } = useTranslation(); const location = useLocation(); - const { user, logout, isAdmin, isAuthenticated } = useAuthStore(); + const { user, logout, isAdmin } = useAuthStore(); const { toggleTheme, isDark } = useTheme(); const { haptic, platform } = usePlatform(); const [userPhotoUrl, setUserPhotoUrl] = useState(null); @@ -112,15 +110,6 @@ export function AppHeader({ }); const canToggle = enabledThemes?.dark && enabledThemes?.light; - // Promo active check - const { data: activeDiscount } = useQuery({ - queryKey: ['active-discount'], - queryFn: promoApi.getActiveDiscount, - enabled: isAuthenticated, - staleTime: 30000, - }); - const isPromoActive = activeDiscount?.is_active && activeDiscount?.discount_percent; - // Get user photo from Telegram useEffect(() => { try { @@ -273,16 +262,10 @@ export function AppHeader({ )} -
setMobileMenuOpen(false)}> - -
setMobileMenuOpen(false)}>
-
setMobileMenuOpen(false)} - > +
setMobileMenuOpen(false)}>
@@ -358,7 +341,6 @@ export function AppHeader({
- {isPromoActive && }
{/* Nav items */}